-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: alpha release of design tokens (#1770)
- Loading branch information
1 parent
5543854
commit c6d4a18
Showing
162 changed files
with
10,686 additions
and
965 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ dependent-usage-analyzer/ | |
build-scss.js | ||
component-generator/ | ||
example/ | ||
style-dictionary-build/ | ||
build-tokens.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -467,3 +467,21 @@ The assigned maintainers for this component and other project details may be fou | |
Please do not report security issues in public. Please email [email protected]. | ||
|
||
We tend to prioritize security issues which impact the published `@edx/paragon` NPM library more so than the [documentation website](https://paragon-openedx.netlify.app/) or example React application. | ||
|
||
## Design Tokens | ||
|
||
Design tokens are all the values needed to build and maintain a design system — spacing, color, typography, object styles, etc. They can represent anything defined by the design: color as an RGB value, opacity as a number, spacing as a REM value. They are used instead of hard-coded values to provide flexibility and uniformity across the application. | ||
|
||
### Design Tokens in Paragon | ||
|
||
Folder `tokens` in the project root contains split by categories `json` files. They consist of `JSON` objects that store information about the variable name and its value. Scripts that also reside in the `tokens` folder provide following facilities: build tokens into `css`, `scss` variables, map `scss` to `css` variables and replace old `scss` to new `css` variables. | ||
|
||
### Usage | ||
|
||
``` | ||
cd tokens | ||
npm install | ||
npm run build-tokens # creates "build" folder with scss and css variables based on json tokens | ||
npm run build-scss-to-css-map # creats scss-to-css-core.json and scss-to-css-components.json | ||
npm run replace-variables -- --path ../src # this will replace all scss variables in the project with the new css variables based on the "scss-to-css-core.json" and "scss-to-css-components.json" files | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
18. Design tokens with Style Dictionary | ||
--------------------------------------- | ||
|
||
Status | ||
------ | ||
|
||
Proposed | ||
|
||
Context | ||
------- | ||
|
||
Decision | ||
-------- | ||
|
||
Consequences | ||
------------ | ||
|
||
Resources | ||
--------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@import "tokens"; | ||
@import "functions"; | ||
@import "variables"; | ||
@import "~bootstrap/scss/mixins"; | ||
|
Oops, something went wrong.