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

Replace auto-generated typography classes with CSS variables #2392

Closed
mimarz opened this issue Sep 9, 2024 · 0 comments · Fixed by #2429
Closed

Replace auto-generated typography classes with CSS variables #2392

mimarz opened this issue Sep 9, 2024 · 0 comments · Fixed by #2429
Assignees
Labels
cli @digdir/designsystemet $ tokens Everything related to tokens and Work related to @digdir/designsystemet-theme

Comments

@mimarz
Copy link
Collaborator

mimarz commented Sep 9, 2024

In an effort to remove "hidden" linking between typography classes and brittle code we will remove the autogenerated typography classes and instead use the default css variables for typgraphy composite tokens.

We will need to update/remove the SD (Style Dictionary) format and config for Typography in packages/cli/src/tokens/build

@mimarz mimarz converted this from a draft issue Sep 9, 2024
@mimarz mimarz added $ tokens Everything related to tokens and Work related to @digdir/designsystemet-theme cli @digdir/designsystemet labels Sep 9, 2024
@mimarz mimarz self-assigned this Sep 16, 2024
mimarz added a commit that referenced this issue Sep 17, 2024
mimarz added a commit that referenced this issue Sep 17, 2024
mimarz added a commit that referenced this issue Sep 19, 2024
mimarz added a commit that referenced this issue Sep 19, 2024
resolves #2392

- Removed `typography` in name from typography CSS variables (This
touched a lot of files).
- Removed generated CSS classes.
  - Replaced with deconstructed CSS variable for each prop.
- Replicated current classes with new CSS variables to make sure
everything was still working.
- ⚠️ Paragraph typography variants, `short` & `long` needs to be
separate classes to support `@composes` as it colides with other
components `variant`.
  - For example `Button` `variant`.
  - I would think this is a minor tradeoff.
- Saving rewrite of typography classes to new CSS convention for
separate PR as this is big enough.
- Concatenated `base` layer with `utilities` and `typography`


Look at "old" changes in commit
2e0c899
on how `Button` and `Paragraph` can be updated to follow the new
convention.
@github-project-automation github-project-automation bot moved this from 👀 Ready for review to ✅ Done in Team Design System Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli @digdir/designsystemet $ tokens Everything related to tokens and Work related to @digdir/designsystemet-theme
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants