Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 47 additions & 10 deletions .github/workflows-figma/skin-icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# bound variable, NONZERO winding
# rule, SCALE constraints)
name: Brand set icon validation
version: 1.0
version: 1.1
scope: page:"Icons" # current-page | current-file | selection | page:"Name"

steps:
Expand Down Expand Up @@ -41,7 +41,44 @@ steps:
severity: error
with: { property: type, equals: COMPONENT }

# 3. Re-select more broadly (`scope: descendants`, no frame restriction):
# 3. Each style frame may only contain components with its matching suffix.
- uses: select
with:
types: [FRAME]
scope: top-level
nameMatches: "^Light$"
- uses: select.children
- uses: assert.nameMatches
name: Light icon naming
description: Every component directly inside the Light frame must end in -light.
severity: error
with: { pattern: "^[a-z0-9-]*-light$" }

- uses: select
with:
types: [FRAME]
scope: top-level
nameMatches: "^Regular$"
- uses: select.children
- uses: assert.nameMatches
name: Regular icon naming
description: Every component directly inside the Regular frame must end in -regular.
severity: error
with: { pattern: "^[a-z0-9-]*-regular$" }

- uses: select
with:
types: [FRAME]
scope: top-level
nameMatches: "^Filled$"
- uses: select.children
- uses: assert.nameMatches
name: Filled icon naming
description: Every component directly inside the Filled frame must end in -filled.
severity: error
with: { pattern: "^[a-z0-9-]*-filled$" }

# 4. Re-select more broadly (`scope: descendants`, no frame restriction):
# every component anywhere on the page — not just inside a style frame —
# must carry the style suffix, so downstream tooling can identify its
# variant regardless of where it lives.
Expand All @@ -55,7 +92,7 @@ steps:
severity: error
with: { pattern: "^[a-z0-9-]*(-regular|-filled|-light)$" }

# 4. Same page-wide selection: every icon component must be exactly 24x24.
# 5. Same page-wide selection: every icon component must be exactly 24x24.
- uses: select
with:
types: [COMPONENT]
Expand All @@ -69,7 +106,7 @@ steps:
- { property: width, equals: 24 }
- { property: height, equals: 24 }

# 5. No two icon components anywhere on the page may share the exact same
# 6. No two icon components anywhere on the page may share the exact same
# name — this asserts against the whole page, not per-node, since it is
# comparing siblings against each other rather than checking one node in
# isolation.
Expand All @@ -78,7 +115,7 @@ steps:
description: No two icon components may share the exact same name. A duplicate usually means an accidental copy-paste that was never renamed.
severity: error

# 6. From here on, checks apply only to the icon's inner vector layer.
# 7. From here on, checks apply only to the icon's inner vector layer.
# Narrow the selection to components that already carry the style suffix
# (excludes anything stray/unfinished still failing step 3) and hop down to
# their single child layer.
Expand All @@ -94,7 +131,7 @@ steps:
severity: error
with: { property: windingRule, notEquals: EVENODD }

# 7. That same inner layer must scale proportionally with the component,
# 8. That same inner layer must scale proportionally with the component,
# in both directions.
- uses: select
with:
Expand All @@ -111,7 +148,7 @@ steps:
- { property: constraints.horizontal, equals: SCALE }
- { property: constraints.vertical, equals: SCALE }

# 8. `assert.childCount` runs on the components (the current selection), so
# 9. `assert.childCount` runs on the components (the current selection), so
# it counts each suffix-named icon component's OWN children — more than one
# usually means ungrouped or leftover shapes.
- uses: select
Expand All @@ -125,7 +162,7 @@ steps:
severity: error
with: { equals: 1 }

# 9. That single child layer must be named exactly "icon" (re-select and hop
# 10. That single child layer must be named exactly "icon" (re-select and hop
# down again, since step 8 needed the components themselves, not their
# children).
- uses: select
Expand All @@ -140,7 +177,7 @@ steps:
severity: error
with: { pattern: "^icon$" }

# 10. The inner "icon" vector must have a solid black fill, with no
# 11. The inner "icon" vector must have a solid black fill, with no
# variable/token bound to it — colour is applied elsewhere (e.g. via CSS or
# a wrapping component), so these vectors stay lightweight and skin-agnostic.
- uses: select
Expand All @@ -161,7 +198,7 @@ steps:
- { property: fills.0.color.b, equals: 0 }
- { property: fills.0.boundVariables.color, exists: false }

# 11. Finally, that inner "icon" layer must be a single flattened vector —
# 12. Finally, that inner "icon" layer must be a single flattened vector —
# not a live boolean operation (union, subtract, intersect or exclude) that
# could still change shape if its constituent layers are edited.
- uses: select
Expand Down
Loading