A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
feat(tokens): add design tokens architecture (#29245)
<!-- 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. --> Following the Design Doc for the new Ionic Design System, an architecture for Design Tokens was added. 1. Added new `foundations` folder inside the `src`, to hold all the tokens related files. 2. On this file, a json with all the tokens for the new Design System was added. The format followed was the one suggested on the [W3C draft](https://design-tokens.github.io/community-group/format/). 3. Added a dev dependency for [Styles Dictionary](https://amzn.github.io/style-dictionary/#/), version 3.9.2. 4. Added a tokens.js script that will take care of transforming the json tokens into the desired output. For now, three files are being generated: ionic.vars.css (:root with all CSS Variables); ionic.vars.css (scss variables for each token) and ionic.utility.css (a new utility-class for each token) 5. Added the script `npm run build.tokens` to package.json, that will generate the three files mentioned above. For now, all these changes bring no impact to the rest of the Framework, as these variables are not yet being consumed. The `margin`, `padding` and `border-radius` were removed from the prohibited properties on lint, to prevent lint errors with the new utility-classes. This is very open to discussion/feedback if it's seen as not ok. The `build` command now includes the `build.tokens` script, to make sure the files are always generated, in case someone forget to run the command, after changing the json file! ## Does this introduce a breaking change? - [ ] Yes - [x] 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. 6. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> --------- Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
B
Bernardo Cardoso committed
19f7be8877fd330449ba48d090b41a4a04ce68b3
Parent: 1c4b6bd
Committed by GitHub <noreply@github.com>
on 4/5/2024, 8:27:48 AM