From cd8916c355da55a99818e4e31fd580e263d79dbe Mon Sep 17 00:00:00 2001 From: dangreen Date: Thu, 19 Nov 2026 22:12:59 +0400 Subject: [PATCH 1/3] chore: draw simple shapes and state marks in CSS in ui-component and svg-sprite-icons skills A ring, a tick or a chevron is drawn with CSS at the icons' size and weight, and a mark that shows a state is drawn from that state rather than by swapping icons, which can flash empty while the browser resolves the new picture. Pictures with detail stay SVG icons. --- skills/svg-sprite-icons/SKILL.md | 2 ++ skills/ui-component/SKILL.md | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/skills/svg-sprite-icons/SKILL.md b/skills/svg-sprite-icons/SKILL.md index b56c4ac..f782d79 100644 --- a/skills/svg-sprite-icons/SKILL.md +++ b/skills/svg-sprite-icons/SKILL.md @@ -30,6 +30,8 @@ metadata: Icons are stored as individual SVG files, compiled into a single symbol sprite by a script, and rendered through an `Icon` component that references sprite symbols with ``. The browser downloads one sprite file instead of inlining every icon into the JS bundle. +An icon is a picture with detail, such as a tag or a leaf. A simple shape, a ring, a dot, a tick or a chevron, is drawn in CSS instead, and a state is never shown by swapping one icon for another. + ## Structure ``` diff --git a/skills/ui-component/SKILL.md b/skills/ui-component/SKILL.md index 0c671d2..121e3b8 100644 --- a/skills/ui-component/SKILL.md +++ b/skills/ui-component/SKILL.md @@ -48,7 +48,9 @@ metadata: ``` - Never write global styles in CSS Modules — globals belong only in dedicated files. -- Build simple shapes with HTML+CSS instead of SVG (this scales up to e.g. a burger button animating into a cross). +- Build simple shapes with HTML+CSS instead of SVG: a ring, a dot, a tick, a chevron, a cross, a burger. Draw them with borders, `clip-path` or a pseudo-element in `currentColor`, at the icons' size and line weight. A picture with real detail, such as a tag or a leaf, stays an SVG icon. + - A mark that shows a state, such as a tick in a ring or an open chevron, is drawn from the state itself (`:checked`, `[aria-pressed='true']`, `[aria-expanded='true']`), never by swapping one icon for another: a swapped icon can flash empty while the browser resolves the new picture, and a drawn shape can animate between the states, as a burger turns into a cross. + - Forced colors drop box shadows and repaint backgrounds, which erases a drawn shape. Give the shape `forced-color-adjust: none` and set its `color` to a system color for each state (`ButtonText`, `HighlightText`): what it inherits is the color the page set, not the system's. - Use `currentColor` in icons and similar components (e.g. as SVG `fill`), so consumers set the color via the `color` property. - Write computed values as the source expression, so it's clear where the number comes from: From 2a4207969769b83b29ac25281fbd41366952edef Mon Sep 17 00:00:00 2001 From: dangreen Date: Thu, 19 Nov 2026 22:26:58 +0400 Subject: [PATCH 2/3] chore: draw a shape with a border under forced colors in ui-component skill --- skills/ui-component/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/ui-component/SKILL.md b/skills/ui-component/SKILL.md index 121e3b8..881d47c 100644 --- a/skills/ui-component/SKILL.md +++ b/skills/ui-component/SKILL.md @@ -50,7 +50,7 @@ metadata: - Never write global styles in CSS Modules — globals belong only in dedicated files. - Build simple shapes with HTML+CSS instead of SVG: a ring, a dot, a tick, a chevron, a cross, a burger. Draw them with borders, `clip-path` or a pseudo-element in `currentColor`, at the icons' size and line weight. A picture with real detail, such as a tag or a leaf, stays an SVG icon. - A mark that shows a state, such as a tick in a ring or an open chevron, is drawn from the state itself (`:checked`, `[aria-pressed='true']`, `[aria-expanded='true']`), never by swapping one icon for another: a swapped icon can flash empty while the browser resolves the new picture, and a drawn shape can animate between the states, as a burger turns into a cross. - - Forced colors drop box shadows and repaint backgrounds, which erases a drawn shape. Give the shape `forced-color-adjust: none` and set its `color` to a system color for each state (`ButtonText`, `HighlightText`): what it inherits is the color the page set, not the system's. + - Forced colors drop box shadows and repaint backgrounds, which erases a drawn shape, but keep borders in the system's ink, as they keep an icon's stroke, the highlight's text included where a control is drawn pressed. Draw the shape with a border there: a ring as a border, a filled shape as a top border as tall as the shape, with `background: none`. - Use `currentColor` in icons and similar components (e.g. as SVG `fill`), so consumers set the color via the `color` property. - Write computed values as the source expression, so it's clear where the number comes from: From 9e92687f6e3635bf01746dfcd9e50c9c4d5796d9 Mon Sep 17 00:00:00 2001 From: dangreen Date: Thu, 19 Nov 2026 22:32:37 +0400 Subject: [PATCH 3/3] chore: keep shared glyphs as icons and turn one chevron in svg-sprite-icons and ui-component skills --- skills/svg-sprite-icons/SKILL.md | 2 +- skills/ui-component/SKILL.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/skills/svg-sprite-icons/SKILL.md b/skills/svg-sprite-icons/SKILL.md index f782d79..3f45be0 100644 --- a/skills/svg-sprite-icons/SKILL.md +++ b/skills/svg-sprite-icons/SKILL.md @@ -30,7 +30,7 @@ metadata: Icons are stored as individual SVG files, compiled into a single symbol sprite by a script, and rendered through an `Icon` component that references sprite symbols with ``. The browser downloads one sprite file instead of inlining every icon into the JS bundle. -An icon is a picture with detail, such as a tag or a leaf. A simple shape, a ring, a dot, a tick or a chevron, is drawn in CSS instead, and a state is never shown by swapping one icon for another. +An icon is a glyph that many components show, or a picture with detail, such as a tag or a leaf. A component's own simple mark, a ring, a dot or a tick, is drawn in CSS instead, and a state is never shown by swapping one icon for another. A picture that only points another way is one symbol: the `Icon` component turns it in CSS, as a chevron that points down is turned a quarter to point left or right. ## Structure diff --git a/skills/ui-component/SKILL.md b/skills/ui-component/SKILL.md index 881d47c..c7207c0 100644 --- a/skills/ui-component/SKILL.md +++ b/skills/ui-component/SKILL.md @@ -48,8 +48,8 @@ metadata: ``` - Never write global styles in CSS Modules — globals belong only in dedicated files. -- Build simple shapes with HTML+CSS instead of SVG: a ring, a dot, a tick, a chevron, a cross, a burger. Draw them with borders, `clip-path` or a pseudo-element in `currentColor`, at the icons' size and line weight. A picture with real detail, such as a tag or a leaf, stays an SVG icon. - - A mark that shows a state, such as a tick in a ring or an open chevron, is drawn from the state itself (`:checked`, `[aria-pressed='true']`, `[aria-expanded='true']`), never by swapping one icon for another: a swapped icon can flash empty while the browser resolves the new picture, and a drawn shape can animate between the states, as a burger turns into a cross. +- Build a component's own simple marks with HTML+CSS instead of SVG: a ring, a dot, a tick, a burger that turns into a cross. Draw them with borders, `clip-path` or a pseudo-element in `currentColor`, at the icons' size and line weight. A glyph that many components show, such as a chevron, stays an icon of the set, and so does a picture with real detail, such as a tag or a leaf. + - A mark that shows a state, such as a tick in a ring or a chevron turned open, is drawn from the state itself (`:checked`, `[aria-pressed='true']`, `[aria-expanded='true']`), never by swapping one icon for another: a swapped icon can flash empty while the browser resolves the new picture, and a drawn shape can animate between the states, as a burger turns into a cross. - Forced colors drop box shadows and repaint backgrounds, which erases a drawn shape, but keep borders in the system's ink, as they keep an icon's stroke, the highlight's text included where a control is drawn pressed. Draw the shape with a border there: a ring as a border, a filled shape as a top border as tall as the shape, with `background: none`. - Use `currentColor` in icons and similar components (e.g. as SVG `fill`), so consumers set the color via the `color` property. - Write computed values as the source expression, so it's clear where the number comes from: