Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Correct token nesting for inverse color #1246

Closed
wants to merge 2 commits into from

Conversation

VincentSmedinga
Copy link
Contributor

This doesn’t affect the actual token names, but having inverse-color as a level violates the rule that the name of the leaf must be a CSS property.

Copy link
Contributor

@RubenSibon RubenSibon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -6,7 +6,11 @@
"font-size": { "value": "{ams.text.level.3.font-size}" },
"font-weight": { "value": "{ams.text.font-weight.bold}" },
"line-height": { "value": "{ams.text.level.3.line-height}" },
"inverse-color": { "value": "{ams.color.primary-white}" }
"inverse": {
"color": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means the modifier name is now 'inverse', right, not 'inverse-color'?

So it should be ams-paragraph--inverse, for example?

Or should the token be ams.paragraph.inverse-color.color?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I’ve mentioned this change in a broader ticket on this API. We can leave this as is until then.

@@ -6,7 +6,11 @@
"font-size": { "value": "{ams.text.level.3.font-size}" },
"font-weight": { "value": "{ams.text.font-weight.bold}" },
"line-height": { "value": "{ams.text.level.3.line-height}" },
"inverse-color": { "value": "{ams.color.primary-white}" }
"inverse": {
"color": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the token structure is technically a breaking change, I think

@VincentSmedinga
Copy link
Contributor Author

Closing – doing this right requires changing CSS classes and React props as well, and we’re planning to revisit the entire API around colours soon anyway.

@VincentSmedinga VincentSmedinga deleted the chore/inverse-color-token-nesting branch June 3, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants