Skip to content

Commit a5a7bee

Browse files
BenOsodracIonitronthetaPC
authored
feat(tokens): update tokens architecture and usage (#29950)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Removed old tokens stored on foundations folder. Now the jsons with the tokens come from the new dependency: https://github.com/OutSystems/outsystems-design-tokens. - The tokens from UX Team completely changed the structure and in some cases the values. Everything was replaced on the project to use the new tokens. - Snapshots updated and differences reviewed with UX Team. A fix was done on the testing css, to make sure the correct _Inter_ font-family was actually used. This resulted in some differences on the text for some componentes, that had snapshots with the native fonts. - Removed generation of scss file on tokens script, that contained the :root selector with the custom CSS properties, as they were not used on the Ionic context. - Removed generation of html file with tokens preview, as there wasn't a great value on this (we have storybook on other contexts) and it allowed to reduce a lot of code and complexity from the tokens script. - The token command was adapted to use the command available from the https://github.com/OutSystems/outsystems-design-tokens package, using the `--config` prop, where we pass the path to our Ionic token script, where we generate the needed scss variables and utility-classes (by default the tokens repo tries to be as agnostic as possible, and only generates the css variables, without the prefix and added details we need on the Ionic side). - Removed the token command from the npm run build, as it unnecessarily added time on that command to run. Besides, it should not be common that we need to run this command in the future. - Updated reference to latest version of [Style Dictionary 4.1.3](https://v4.styledictionary.com/version-4/statement/). Version 4 comes with a lot of improvements, but also breaking-changes, so it was needed to adapt the tokens script. The code on the script is also now cleaner. - Changed prefix from ionic to ion. The term ionic was used initially, to help differentiate from the old ios/md stuff, but I feel with the current scss architecture, that is no longer needed, and we can use the same prefix across themes. This requires to run `npm install ` again. ## Does this introduce a breaking change? - [x] Yes - [ ] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> --------- Co-authored-by: ionitron <[email protected]> Co-authored-by: Maria Hutt <[email protected]>
1 parent 4d81c8f commit a5a7bee

File tree

477 files changed

+6213
-9347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

477 files changed

+6213
-9347
lines changed

core/package-lock.json

Lines changed: 1131 additions & 339 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,21 @@
6666
"fs-extra": "^9.0.1",
6767
"jest": "^29.7.0",
6868
"jest-cli": "^29.7.0",
69+
"outsystems-design-tokens": "^1.0.1",
6970
"prettier": "^2.8.8",
7071
"rollup": "^2.26.4",
7172
"sass": "^1.33.0",
7273
"serve": "^14.0.1",
73-
"style-dictionary": "^3.9.2",
74+
"style-dictionary": "^4.1.3",
7475
"stylelint": "^13.13.1",
7576
"stylelint-order": "^4.1.0"
7677
},
7778
"scripts": {
78-
"build": "npm run clean && npm run build.tokens && npm run build.css && stencil build --es5 --docs-json dist/docs.json",
79+
"build": "npm run clean && npm run build.css && stencil build --es5 --docs-json dist/docs.json",
7980
"build.css": "npm run css.sass && npm run css.minify",
8081
"build.debug": "npm run clean && stencil build --debug",
8182
"build.docs.json": "stencil build --docs-json dist/docs.json",
82-
"build.tokens": "node ./scripts/tokens/index.js && npm run lint.fix && npm run prettier.tokens",
83+
"build.tokens": "npx build.tokens --config scripts/tokens/index.js && npm run prettier.tokens",
8384
"clean": "node scripts/clean.js",
8485
"css.minify": "cleancss -O2 -o ./css/ionic.bundle.css ./css/ionic.bundle.css",
8586
"css.sass": "sass --embed-sources --style compressed src/css:./css",

core/scripts/testing/styles.css

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)