Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ components:
backgroundColor: "{colors.tertiary-container}"
```

Valid component properties: `backgroundColor`, `textColor`, `typography`, `rounded`, `padding`, `size`, `height`, `width`.
Valid component properties: `backgroundColor`, `textColor`, `typography`, `rounded`, `padding`, `paddingX`, `paddingY`, `size`, `height`, `width`.

Variants (hover, active, pressed) are expressed as separate component entries with a related key name.

Expand Down
2 changes: 2 additions & 0 deletions docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ Each component has a set of properties that are themselves design tokens:
- typography: \<Typography\>
- rounded: \<Dimension\>
- padding: \<Dimension\>
- paddingX: \<Dimension\>
- paddingY: \<Dimension\>
- size: \<Dimension\>
- height: \<Dimension\>
- width: \<Dimension\>
Expand Down
10 changes: 10 additions & 0 deletions packages/cli/src/linter/linter/rules/broken-ref.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ describe('brokenRef', () => {
expect(subTokenDiag!.severity).toBe('warning');
});

it('does not emit warning for paddingX and paddingY sub-tokens', () => {
const state = buildState({
colors: { primary: '#ff0000' },
components: { button: { paddingX: '12px', paddingY: '16px' } },
});
const findings = brokenRef(state);
const subTokenDiag = findings.filter(d => d.message.includes('not a recognized'));
expect(subTokenDiag.length).toBe(0);
});

it('has a valid rule descriptor', () => {
expect(brokenRefRule.name).toBe('broken-ref');
expect(brokenRefRule.severity).toBe('error');
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/linter/spec-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ component_sub_tokens:
type: Dimension
- name: padding
type: Dimension
- name: paddingX
type: Dimension
- name: paddingY
type: Dimension
- name: size
type: Dimension
- name: height
Expand Down