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

[BD-46] alpha release of design tokens #1770

Merged
merged 20 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f498215
[BD-46] feat: Style dictionary setting (#1571)
PKulkoRaccoonGang Sep 2, 2022
043f266
[BD-46] feat: map and replace scss vars (#1596)
monteri Sep 6, 2022
252bca8
refactor: move tokens code to a separate package (#1608)
viktorrusakov Sep 7, 2022
9fe31ca
[BD-46] implement and use CSS variables in components (#1614)
PKulkoRaccoonGang Sep 16, 2022
4565da0
[BD-46] fix: replace variables (#1619)
monteri Sep 19, 2022
d38e1e9
[BD-46] DRAFT: replace of variables SCSS to CSS (#1633)
PKulkoRaccoonGang Sep 30, 2022
7c9ad6e
feat: add initial documentation (#1623)
monteri Sep 30, 2022
23573ea
chore: remove variables related to www project from design tokens
viktorrusakov Oct 12, 2022
7cc79e4
refactor: update json schema of design tokens
viktorrusakov Oct 24, 2022
04d6114
refactor: update css variables usage
viktorrusakov Oct 24, 2022
b5ba413
chore: undo scss replacement
viktorrusakov Oct 31, 2022
6ad31ad
feat: add new script to replace definitions of SCSS variable with CSS…
viktorrusakov Nov 1, 2022
e917046
feat: introduce initial alias tokens
viktorrusakov Nov 2, 2022
045290b
fix: use css variables for zindex property
viktorrusakov Nov 4, 2022
637c457
[BD-46] refactor: refactoring tokens of the Paragon documentation sit…
PKulkoRaccoonGang Nov 4, 2022
95c6a1b
feat: add sass functions design tokens transform
viktorrusakov Nov 6, 2022
340a6ba
[BD-46] feat: update design tokens (#1748)
PKulkoRaccoonGang Nov 14, 2022
5cb2c8d
Merge branch 'alpha' into feat/design-tokens
viktorrusakov Nov 18, 2022
eca58eb
chore: add alpha/beta to releaserc
adamstankiewicz Nov 18, 2022
7d6e9ab
chore: add prerelease to beta/alpha
adamstankiewicz Nov 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ dependent-usage-analyzer/
build-scss.js
component-generator/
example/
style-dictionary-build/
build-tokens.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jest*
dist
src/i18n/transifex_input.json
src/i18n/temp
style-dictionary-build

# gatsby files
www/.cache/
Expand Down
7 changes: 6 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"branches": ["master", "next"],
"branches": [
"master",
"next",
{ "name": "alpha", "prerelease": true },
{ "name": "beta", "prerelease": true }
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down
5 changes: 4 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"ignoreProperties": ["xs", "sm", "md", "lg", "xl", "xxl"]
}],
"alpha-value-notation": "number",
"color-function-notation": "legacy"
"color-function-notation": "legacy",
"value-keyword-case": ["lower", {
"ignoreProperties": ["/font-family/"]
}]
}
}
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,21 @@ BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite
Paragon is distributed on npm as ES6 modules. This means that webpack can use treeshaking on any Paragon components that a consuming app is not using, resulting in greatly reduced bundle sizes.

To get treeshaking to work, your app may require some updates - most notably, Babel 7. See this PR for an example of the changes necessary to update an app to take advantage of treeshaking with Paragon: https://github.com/openedx/frontend-app-payment/pull/48

## 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
```
19 changes: 19 additions & 0 deletions docs/decisions/0018-design-tokens-style-dictionary.rst
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
---------
20 changes: 9 additions & 11 deletions scss/core/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,13 @@ $embed-responsive-aspect-ratios: join(
//
// Font, line-height, and color for body text, headings, and more.

// stylelint-disable value-keyword-case
$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
$font-family-serif: serif !default;
$font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace !default;
$font-family-base: $font-family-sans-serif !default;
// stylelint-enable value-keyword-case

$font-size-base: 1.125rem !default; // Assumes the browser default, typically `16px`
$font-size-lg: $font-size-base * 1.25 !default;
Expand Down Expand Up @@ -789,15 +787,15 @@ $table-th-font-weight: null !default;
// Warning: Avoid customizing these values. They're used for a bird's eye view
// of components dependent on the z-axis and are designed to all work together.

$zindex-dropdown: 1000 !default;
$zindex-sticky: 1020 !default;
$zindex-fixed: 1030 !default;
$zindex-sheet-backdrop: 1031 !default;
$zindex-sheet: 1032 !default;
$zindex-modal-backdrop: 1040 !default;
$zindex-modal: 1050 !default;
$zindex-popover: 1060 !default;
$zindex-tooltip: 1070 !default;
$zindex-dropdown: var(--pgn-dropdown-zindex) !default;
$zindex-sticky: var(--pgn-zindex-sticky) !default;
$zindex-fixed: var(--pgn-zindex-fixed) !default;
$zindex-sheet-backdrop: var(--pgn-sheet-zindex-backdrop) !default;
$zindex-sheet: var(--pgn-sheet-zindex-main) !default;
$zindex-modal-backdrop: var(--pgn-modal-backdrop-zindex) !default;
$zindex-modal: var(--pgn-modal-zindex) !default;
$zindex-popover: var(--pgn-popover-zindex) !default;
$zindex-tooltip: var(--pgn-tooltip-zindex) !default;

// Buttons + Forms
//
Expand Down
1 change: 1 addition & 0 deletions scss/core/core.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "tokens";
@import "functions";
@import "variables";
@import "~bootstrap/scss/mixins";
Expand Down
Loading