Skip to content

feat: support axis-specific padding component sub-tokens - #166

Open
zachshallbetter wants to merge 1 commit into
google-labs-code:mainfrom
zachshallbetter:feat/axis-padding
Open

feat: support axis-specific padding component sub-tokens#166
zachshallbetter wants to merge 1 commit into
google-labs-code:mainfrom
zachshallbetter:feat/axis-padding

Conversation

@zachshallbetter

@zachshallbetter zachshallbetter commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Implemented support for axis-specific padding properties (paddingX and paddingY) inside component token definitions (resolves Issue #160).

Background & Motivation

By default, the linter and spec support a uniform padding sub-token for components. However, asymmetric layouts (e.g., text inputs with different vertical and horizontal offsets) are standard in production design systems. Adding paddingX and paddingY addresses this capability gap natively.

Changes

  • Configuration:
    • Add paddingX and paddingY to the recognized component_sub_tokens schema list in spec-config.yaml.
  • Test Coverage:
    • Add validation tests in broken-ref.test.ts verifying that component definitions containing paddingX and paddingY do not emit unrecognized sub-token warnings.
  • Documentation:
    • Update the valid component properties list in README.md.
    • Regenerate docs/spec.md using the spec compiler.

Implemented support for axis-specific padding properties (paddingX and paddingY) inside component token definitions (resolves Issue google-labs-code#160).

* Background & Motivation:
  - By default, the linter and spec support a uniform 'padding' sub-token for components. However, asymmetric layouts (e.g. button rows or inputs with larger horizontal than vertical insets) are standard in production design systems. Adding 'paddingX' and 'paddingY' solves this gap natively.
  - This matches common framework models (Tailwind's px/py, SwiftUI, Flutter) and avoids nested layout complexity (such as the schemas discussed in Issue google-labs-code#17).
  - This aligns with the philosophy of PR google-labs-code#89 (avoiding CSS property bloat like paddingLeft/paddingTop) by introducing structural layout minimums rather than exhaustive box-model properties.
  - Sourced independently from PR google-labs-code#164 to prevent merge conflicts.

* Changes:
  - Add 'paddingX' and 'paddingY' to component_sub_tokens list in spec-config.yaml.
  - Update the valid component properties list in README.md.
  - Regenerate docs/spec.md using the compiler script.

* Test Coverage:
  - Add validation tests in broken-ref.test.ts to verify that components using paddingX and paddingY do not trigger unrecognized sub-token warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant