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

[#2452] Add paragraph tokens, bump version #9

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

jiromaykin
Copy link
Collaborator

@jiromaykin jiromaykin commented May 21, 2024

Add tokens for paragraphs, and expand Body tokens + bump version
Issue: https://taiga.maykinmedia.nl/project/open-inwoner/task/2452

Version number starts from 0.0.5... because the Buttons PR already has version 0.0.4...

Ugly commits were rebased here but can still be seen on https://www.npmjs.com/package/@open-inwoner/design-tokens?activeTab=versions since NPM is not dependent on commits.

@jiromaykin jiromaykin changed the title [#2452] Added paragraph tokens, bumped version [#2452] Add paragraph tokens, bump version May 21, 2024
@jiromaykin jiromaykin force-pushed the feature/2452-add-paragraph-tokens branch 5 times, most recently from 49a9be4 to 432b077 Compare May 27, 2024 13:24
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
"paragraph": {
"small": {
"font-size": {
"value": "14px"
Copy link
Contributor

Choose a reason for hiding this comment

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

As I noted in your related PR, I'd prefer variable names with the size indicator at the end: oip-utrecht-paragraph-font-size-small, oip-utrecht-paragraph-font-size-medium, and so on. Differing strings are easier to discern if the differing part is at the end.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As noted in OIP PR nr.1215: NL Design System works differently.
It first defines the modifier from a component (in this case 'small') and then it sets the attributes for those modifiers (in this case 'line-height'), that then finally will receive their value from JSON.
I know it is confusing, but these are SCSS variables, which are not the same as HTML classnames.

Copy link
Collaborator Author

@jiromaykin jiromaykin May 30, 2024

Choose a reason for hiding this comment

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

Oh yeah, and another season why you don't want to have dash-separated stuff that all start with the same 'name' but need different values, is because the style-dictionary package would merge and throw away everything that starts with font-size-blah-blah, so all that start with font-size-small/font-size-default/font-size-large.. .etc. would just be ignored and not be part of the build.
So that is why in the Readme it says the structure needs to be
<prefix>.<component>.<modifier>.<UIState>.<CSSProperty>

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good explanation. Makes sense now.

@jiromaykin jiromaykin requested a review from pi-sigma May 30, 2024 18:05
@jiromaykin jiromaykin merged commit 5cf1ec6 into main Jun 6, 2024
2 checks passed
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.

2 participants