fix(cli): support secondary fontFamily in schema and in tokens#4394
fix(cli): support secondary fontFamily in schema and in tokens#4394Promises wants to merge 1 commit intodigdir:mainfrom
Conversation
🦋 Changeset detectedLatest commit: d1b444c The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Hey! Thanks for the contribution, we are actually currently in the process of reworking/improving the typography token structure. We have planned some changes to the config in this regard also. I'll have to check how whats the plane atm, is this something you need currently for you project? |
Yes I a updated a 1.0.0 project, which uses a different font for titles, I look forward to your planned changes. But this one is very much needed soon. |
Are you using the cli or config file for creating tokens? |
Just migrated to the config file "theme" repo https://github.com/PorticoEstate/digdir-design-tokens frontend (aktiv-kommune): https://github.com/PorticoEstate/PorticoEstate-v2/tree/master/src/modules/bookingfrontend/client |
Good morning! We had a small talk about how users should configure typography, and this might change in the future to be more flexible and scalable. Not sure if we want to add this feature just to be removed in the future, let use examine this possibility closer :) Nice work on aktive-kommune btw! 👏 |
|
Hi! We are a bit hesitant to add this now as it would already effectively deprecated. We are planning to change how typography is structured in tokens and also defined in the config. A team member suggested you can try using yq in your post create tokens script to edit the secondary typography token. yqWe have also updated out design-tokens template with a new workflow, you use this as inspiration. https://github.com/designsystemet/design-tokens/blob/main/.github/workflows/generate-tokens.yml |
To be more clear, I suggest adding something like this to your package.json: "scripts": {
"postprocess-tokens": "yq --inplace '.portal.\"font-family\".\"$value\" |= \"Poppins\"' ./primitives/modes/typography/secondary/portal.json"
"create": "designsystemet tokens create && npm run postprocess-tokens"
// ...your other scripts...
}Then you run |
|
Closing this now due to now activity. Please contact us again if there is anything else :) |
Summary
This PR adds support for configuring a secondary font family in the CLI. Users can now specify a different font family for secondary typography using the
--secondary-font-familyoption when generating tokens. If not specified, it falls back to the primary font family. This enables more flexible typography configuration for themes that require different font families for primary and secondary text.Checks
pnpm changesetif relevant)