feat(spec): add textTransform typography token#49
Conversation
This enables machine-readable casing rules such as uppercase labels, and updates the spec, README, model handling, and model tests.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@davideast what do you think? |
|
Hey @edgarasben! Thank you for taking the time to contribute! I'm a bit on the fence about this one. One one hand it fits in nicely with the tokens but on the other it also is common to see in prose within the typography section. We need to figure out a better way to prevent contradictions via prose and tokens and also tackling variants so you are not fixed to only uppercase headings for everything. Let me look over some of the proposals and ideas for contradictions and variants and I'll get back to you shortly. |
|
@davideast in my experience, some brands prefer some or all of their title/heading styles to be in uppercase for example. |
|
Hey @edgarasben, apologies for the delay but I'm finally following up on this. Since my last reply we published a PHILOSOPHY.md that explains the direction for how the spec evolves. The core idea is that the spec defines a structural minimum and the prose is where the design lives. The model already knows CSS. It doesn't need
What we're building instead is a configurable linter (#89 raised the same tension from a different angle). Projects will be able to register custom properties that the linter recognizes, so your design system can use In the meantime, you can already use I'm going to close this PR for now since we're not expanding the core typography vocabulary at this time. But the use case is valid and will be supported through configuration. Thank you for raising it. |
Summary
Adds
textTransformas an optional typography token property.This enables DESIGN.md files to express text casing rules, such as uppercase labels, in a machine-readable way instead of relying only on prose.
Motivation
Text casing is currently only expressible through natural language, for example:
That works for humans, but it is harder for tooling and agents to interpret consistently. Adding
textTransformlets a design system define casing behavior directly in typography tokens.Example
Changes
Compatibility
This is optional and backward-compatible. Existing DESIGN.md files do not need to change.