- 可能であれば Chrome の文字拡大機能をサポートするために
remを使用する。 - ただし、実際に Chrome の文字拡大機能を「極大」にして検証することが必須条件。これに時間的・労働的なコストを割けないのなら
pxを使用したほうがいい。
「font-size には rem を使いましょう」という教えが独り歩きしており、実際に Chrome の文字拡大機能を「極大」にして検証していない人が多いため。
| fit-text { | |
| display: block flow; | |
| &::part(svg) { | |
| display: block flow; | |
| inline-size: 100%; | |
| block-size: auto; | |
| } | |
| &::part(text) { |
| /** | |
| * 要素の位置情報を監視してCSS変数として:rootに設定するWeb Component | |
| * AnchorPositioningのような位置指定に使用可能 | |
| * | |
| * @example | |
| * ```html | |
| * <rect-observer var-prefix="global-header"> | |
| * <header>...</header> | |
| * </rect-observer> | |
| * ``` |
| export type ObserverOptions = { | |
| root?: HTMLElement | null; | |
| rootMargin?: string; | |
| threshold?: number | number[]; | |
| }; | |
| const defaultOptions: ObserverOptions = { | |
| root: null, | |
| rootMargin: "0px", | |
| threshold: 0 |
ICS MEDIAで新しく掲載された以下の記事を読みました。
https://ics.media/entry/250520/
大前提として、私は ICS MEDIA の記事を愛読していますし、池田さんをはじめとして ICS で働くエンジニアの方々とはリアルで親交もあり、尊敬しています。
上述した「@scope入門」という記事に関しても @scope の基礎的な使い方が纏まっており、黎明期ゆえに文献の少ない @scope にフィーチャーした参考記事としては質の高い記事であることは間違いありません。
| /** | |
| * Add ARIA attributes to table elements and their children. | |
| * When the display property is changed with CSS, the element may not be recognized as a table. | |
| * @see https://adrianroselli.com/2018/05/functions-to-add-aria-to-tables-and-lists.html | |
| * @param {HTMLElement} container - Container element to apply ARIA attributes to | |
| * @returns {void} | |
| */ | |
| function addTableARIA(container: HTMLElement): void { | |
| const tables = container.querySelectorAll<HTMLTableElement>("table"); | |
| for (const table of tables) { |
| module.exports = { | |
| rules: { | |
| 'unit-disallowed-list': [ | |
| [ | |
| 'vw', | |
| 'vh', | |
| 'vi', | |
| 'vb', | |
| 'vmin', | |
| 'vmax' |
| { | |
| "container": { | |
| "prefix": "container", | |
| "body": [ | |
| "--_container-size-min: $1;", | |
| "--_container-size-max: $2;", | |
| "--_to-cqi-min: calc(tan(atan2(1px, var(--_container-size-min))) * 100cqi);", | |
| "--_to-cqi-max: calc(tan(atan2(1px, var(--_container-size-max))) * 100cqi);", | |
| "container: $3 / inline-size;", | |
| "@container style(--debug: true) {", |