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

feat!: reduce global design tokens in calcite.css #8215

Merged
merged 81 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2c21075
feat: token reference syntax should align with design token standards
alisonailea Nov 16, 2023
0340713
feat(font tokens): add italic token style to core tokens
alisonailea Nov 17, 2023
c7dae06
feat(border tokens)!: move border tokens into semantic
alisonailea Nov 17, 2023
b5449f0
feat(sizing tokens)!: update token names
alisonailea Nov 17, 2023
e736b43
feat(spacing tokens): move spaing tokens to semantic
alisonailea Nov 17, 2023
2a52547
feat(breakpoint tokens)!: remove breakpoints from global output
alisonailea Nov 17, 2023
57e58a2
feat(stacking tokens): move z-index to semantic
alisonailea Nov 17, 2023
7d76f17
feat(shadow tokens)!: semantic shadow tokens
alisonailea Nov 17, 2023
c177661
feat(color tokens)!: remove “palette” from core color paths
alisonailea Nov 17, 2023
b3f61c3
feat(color tokens)!: replace light and dark tokens with composite tokens
alisonailea Nov 17, 2023
d8b45ee
feat(color tokens): update colors references
alisonailea Nov 17, 2023
19e80fa
feat(typography tokens): breakout typography tokens
alisonailea Nov 17, 2023
ce4aa94
feat(font tokens)!: semantic font tokens use t-shirt sizing
alisonailea Nov 17, 2023
c375311
fix(font tokens): remove duplicate names from core paths
alisonailea Nov 17, 2023
1101bb6
feat: add semantic opacity tokens
alisonailea Nov 17, 2023
477c9b8
chore: remove unused files
alisonailea Nov 17, 2023
4df08c6
feat(token transformer)!: reduce global output
alisonailea Nov 16, 2023
10dbb90
feat: add $config to src to support new token transformer
alisonailea Nov 17, 2023
36e0d63
fix(tokens): core token references
alisonailea Nov 17, 2023
1fa41fb
fix(tokens)!: update package exports
alisonailea Nov 17, 2023
32679c0
fix(font tokens): capitalize description
alisonailea Nov 17, 2023
54b2362
fix(token transformer): cleanup
alisonailea Nov 18, 2023
2f1a5ba
Merge branch 'rc' into astump/7325-reduce-tokens-output
benelan Nov 18, 2023
4c5e0f5
chore: update scss/headless export
jcfranco Nov 20, 2023
c81f3b1
fix es6 declaration file exports
jcfranco Nov 20, 2023
e887df3
set up fonts + custom dictionary to clean up cspell warnings
jcfranco Nov 20, 2023
c3f8672
update updated imports in responsive module
jcfranco Nov 20, 2023
f1ed856
update tailwind preset and core scss files
jcfranco Nov 20, 2023
4ceebaf
update component-level styles
jcfranco Nov 20, 2023
67660ef
import global CSS vars
jcfranco Nov 20, 2023
4261c5a
work around stencil-sass issues (forward-compatibility, relative CSS …
jcfranco Nov 20, 2023
fa4a2df
fix(shadow tokens): output box-shadow rgba refs
alisonailea Nov 20, 2023
a782408
fix(token transformer): support stencil SCSS with @import
alisonailea Nov 20, 2023
1ed9795
fix(CSS tokens): output class and mixin names
alisonailea Nov 20, 2023
a50c387
fix: update calcite-component global token input
alisonailea Nov 20, 2023
9236436
fix(color tokens): inverse tokens for color mode
alisonailea Nov 20, 2023
df5e15e
fix(calcite-components): remove duplicate variables set in tokens
alisonailea Nov 20, 2023
5749ab3
fix: CC references to calcite-ui-foreground-current
alisonailea Nov 20, 2023
a1cb592
feat(color tokens): add tokens from calcite-components
alisonailea Nov 20, 2023
66d36aa
fix(global.scss): handoff control of tokens and modes to calcite-desi…
alisonailea Nov 20, 2023
762d035
feat(color tokens): add transparent background none
alisonailea Nov 20, 2023
54f4746
Merge branch 'jcfranco/7325-sync-with-calcite-components' of github.c…
alisonailea Nov 20, 2023
1b5fcf1
fix(color tokens): reference correct opacity
alisonailea Nov 20, 2023
680b7a2
chore: fix imports
alisonailea Nov 20, 2023
123b206
fix: format extra output for CSS and SCSS
alisonailea Nov 20, 2023
d92100b
fix: TS output
alisonailea Nov 20, 2023
86743fd
fix: remove color-scheme-imports
alisonailea Nov 20, 2023
7f50c90
fix: design-token package exports
alisonailea Nov 20, 2023
242b16d
fix: design token imports to CC
alisonailea Nov 20, 2023
96d8cbd
chore(token transformer): cleanup tranformer files
alisonailea Nov 21, 2023
78c8993
test(token transformer): add tests
alisonailea Nov 21, 2023
dc3bde3
fix(token transformer): switch hex to RGB in RGBA values
alisonailea Nov 21, 2023
33657d0
fix(button tokens)!: replace button token with background transparent
alisonailea Nov 21, 2023
ae7b9ce
fix(color tokens)!: resolve references to tokens
alisonailea Nov 21, 2023
73e76b5
feat: add missing color tokens
alisonailea Nov 21, 2023
5b8fbe2
rename missed color tokens
jcfranco Nov 21, 2023
d8a131f
fix(typescript tokens): correct types output for JS
alisonailea Nov 21, 2023
85ec5b5
Merge branch 'astump/7325-reduce-tokens-output' of github.com:Esri/ca…
alisonailea Nov 21, 2023
5bdb619
update preset focus color var
jcfranco Nov 21, 2023
91675a9
fix: JS token types output
alisonailea Nov 21, 2023
4764750
fix(typescript tokens): output good types
alisonailea Nov 21, 2023
1efdef6
update module processing for Stencil testing
jcfranco Nov 21, 2023
05ea25b
test: adjust opacity to align with tokens
alisonailea Nov 21, 2023
ae88fd1
fix: import registerFormatterTS remove
alisonailea Nov 21, 2023
2dff59d
Merge branch 'astump/7325-reduce-tokens-output' of github.com:Esri/ca…
alisonailea Nov 21, 2023
3af7ef2
fix: add back quicktype-core
alisonailea Nov 21, 2023
b7ecf29
fix: token references
alisonailea Nov 21, 2023
b9b4377
fix(tokens): update references in calcite-components
alisonailea Nov 22, 2023
145a0d7
fix(opacity tokens): add disabled opacity
alisonailea Nov 22, 2023
d5185f7
restore focus offset invert prop
jcfranco Nov 22, 2023
18859b4
update hardcoded color token
jcfranco Nov 22, 2023
7c30a3e
update color knob labels from loader story
jcfranco Nov 22, 2023
56c3c4c
revert renamed prop from changelog
jcfranco Nov 22, 2023
c8c0b95
fix renamed token in tailwind config affecting icon color
jcfranco Nov 22, 2023
f527feb
use previous name for inverting focus offset to align with token
jcfranco Nov 22, 2023
41e6741
fix(tokens): remove unused token sets
alisonailea Nov 22, 2023
42e411d
fix(offset-invert-focust token): remove from semantic
alisonailea Nov 22, 2023
1eb3d9f
docs(tokens): update README
alisonailea Nov 22, 2023
00c247b
fix(color token): update values to align with design
alisonailea Nov 22, 2023
6e47bc3
fix: update import refs in calcite-componetns includes
alisonailea Nov 22, 2023
a039397
fix(color tokens): update references
alisonailea Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"calcite-dev",
"css",
"en-common-misspellings",
"fonts",
"fullstack",
"html",
"html-symbol-entities",
Expand Down
97 changes: 4 additions & 93 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,13 @@
"jest": "29.7.0",
"jest-axe": "8.0.0",
"jest-cli": "29.7.0",
"json-to-ts": "1.7.0",
"lerna": "7.1.5",
"lint-staged": "13.2.3",
"markdownlint-cli": "0.34.0",
"postcss": "8.4.31",
"prettier": "2.8.8",
"puppeteer": "21.5.0",
"quicktype-core": "23.0.76",
"quicktype-core": "23.0.79",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"rimraf": "5.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/calcite-components/.storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<style>
body {
font-family: var(--calcite-sans-family);
color: var(--calcite-ui-text-1);
background-color: var(--calcite-ui-background);
color: var(--calcite-color-text-1);
background-color: var(--calcite-color-background);
}

calcite-slider {
Expand Down
4 changes: 2 additions & 2 deletions packages/calcite-components/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ If we want to swap the foreground and text colors, we can use the variables:

```css
calcite-notice {
--calcite-ui-foreground-1: #151515;
--calcite-ui-text-1: #ffffff;
--calcite-color-foreground-1: #151515;
--calcite-color-text-1: #ffffff;
}
```

Expand Down
92 changes: 46 additions & 46 deletions packages/calcite-components/calcite-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export default {
theme: {
borderColor: ({ theme }): object => ({
color: {
1: "var(--calcite-ui-border-1)",
2: "var(--calcite-ui-border-2)",
3: "var(--calcite-ui-border-3)",
input: "var(--calcite-ui-border-input)",
1: "var(--calcite-color-border-1)",
2: "var(--calcite-color-border-2)",
3: "var(--calcite-color-border-3)",
input: "var(--calcite-color-border-input)",
transparent: theme("colors.transparent"),
},
"color-brand": theme("colors.brand"),
Expand All @@ -45,29 +45,29 @@ export default {
}),
colors: {
current: "currentColor",
brand: "var(--calcite-ui-brand)",
"brand-hover": "var(--calcite-ui-brand-hover)",
"brand-press": "var(--calcite-ui-brand-press)",
info: "var(--calcite-ui-info)",
success: "var(--calcite-ui-success)",
warning: "var(--calcite-ui-warning)",
danger: "var(--calcite-ui-danger)",
"danger-hover": "var(--calcite-ui-danger-hover)",
"danger-press": "var(--calcite-ui-danger-press)",
brand: "var(--calcite-color-brand)",
"brand-hover": "var(--calcite-color-brand-hover)",
"brand-press": "var(--calcite-color-brand-press)",
info: "var(--calcite-color-info)",
success: "var(--calcite-color-success)",
warning: "var(--calcite-color-warning)",
danger: "var(--calcite-color-danger)",
"danger-hover": "var(--calcite-color-danger-hover)",
"danger-press": "var(--calcite-color-danger-press)",
background: {
background: "var(--calcite-ui-background)",
background: "var(--calcite-color-background)",
foreground: {
1: "var(--calcite-ui-foreground-1)",
2: "var(--calcite-ui-foreground-2)",
3: "var(--calcite-ui-foreground-3)",
1: "var(--calcite-color-foreground-1)",
2: "var(--calcite-color-foreground-2)",
3: "var(--calcite-color-foreground-3)",
},
},
color: {
1: "var(--calcite-ui-text-1)",
2: "var(--calcite-ui-text-2)",
3: "var(--calcite-ui-text-3)",
inverse: "var(--calcite-ui-text-inverse)",
link: "var(--calcite-ui-text-link)",
1: "var(--calcite-color-text-1)",
2: "var(--calcite-color-text-2)",
3: "var(--calcite-color-text-3)",
inverse: "var(--calcite-color-text-inverse)",
link: "var(--calcite-color-text-link)",
icon: "var(--calcite-ui-icon-color)",
},
transparent: "transparent",
Expand Down Expand Up @@ -159,13 +159,13 @@ export default {
boxShadow: {
0: "0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04)",
1: "0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04)",
"1-lg": "0 4px 16px 0 rgba(0, 0, 0, 0.08), 0 2px 8px 0 rgba(0, 0, 0, 0.04)",
"1-lg": "var(--calcite-box-shadow-sm)",
"1-sm": "0 1px 6px -1px rgba(0, 0, 0, 0.16), 0 1px 2px -1px rgba(0, 0, 0, 0.08)",
2: "0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08)",
"2-lg": "0 12px 32px -2px rgba(0, 0, 0, 0.1), 0 4px 20px 0 rgba(0, 0, 0, 0.08)",
"2-lg": "var(--calcite-box-shadow-md)",
"2-sm": "0 2px 12px -4px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.16)",
"border-bottom": "0 1px 0 var(--calcite-ui-border-3)",
"outline-active": "0 0 0 1px var(--calcite-ui-brand)",
"border-bottom": "0 1px 0 var(--calcite-color-border-3)",
"outline-active": "0 0 0 1px var(--calcite-color-brand)",
none: "none",
xs: "0 0 0 1px rgba(0, 0, 0, 0.05)",
outline: "0 0 0 3px rgba(66, 153, 225, 0.5)",
Expand Down Expand Up @@ -211,7 +211,7 @@ export default {
},
},
opacity: {
disabled: "var(--calcite-ui-opacity-disabled)",
disabled: "var(--calcite-opacity-disabled)",
},
spacing: {
0.5: "0.125rem",
Expand All @@ -232,16 +232,16 @@ export default {
menu: "45vh",
},
zIndex: {
deep: "var(--calcite-app-z-index-deep)",
default: "var(--calcite-app-z-index)",
sticky: "var(--calcite-app-z-index-sticky)",
header: "var(--calcite-app-z-index-header)",
toast: "var(--calcite-app-z-index-toast)",
dropdown: "var(--calcite-app-z-index-dropdown)",
overlay: "var(--calcite-app-z-index-overlay)",
modal: "var(--calcite-app-z-index-modal)",
popover: "var(--calcite-app-z-index-popup)",
tooltip: "var(--calcite-app-z-index-tooltip)",
deep: "var(--calcite-z-index-deep)",
default: "var(--calcite-z-index)",
sticky: "var(--calcite-z-index-sticky)",
header: "var(--calcite-z-index-header)",
toast: "var(--calcite-z-index-toast)",
dropdown: "var(--calcite-z-index-dropdown)",
overlay: "var(--calcite-z-index-overlay)",
modal: "var(--calcite-z-index-modal)",
popover: "var(--calcite-z-index-popup)",
tooltip: "var(--calcite-z-index-tooltip)",
},
},
},
Expand All @@ -256,23 +256,23 @@ export default {
"outline-color": "transparent",
},
".focus-normal": {
outline: "2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand))",
outline: "2px solid var(--calcite-color-brand-hover, var(--calcite--color-brand))",
},
".focus-outset": {
outline: "2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand))",
"outline-offset": invert("2px", "--calcite-ui-focus-offset-invert"),
outline: "2px solid var(--calcite-color-brand)",
"outline-offset": invert("2px", "--calcite-offset-invert-focus"),
},
".focus-inset": {
outline: "2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand))",
"outline-offset": invert("-2px", "--calcite-ui-focus-offset-invert"),
outline: "2px solid var(--calcite-color-brand)",
"outline-offset": invert("-2px", "--calcite-offset-invert-focus"),
},
".focus-outset-danger": {
outline: "2px solid var(--calcite-ui-danger)",
"outline-offset": invert("2px", "--calcite-ui-focus-offset-invert"),
outline: "2px solid var(--calcite-color-danger)",
"outline-offset": invert("2px", "--calcite-offset-invert-focus"),
},
".focus-inset-danger": {
outline: "2px solid var(--calcite-ui-danger)",
"outline-offset": invert("-2px", "--calcite-ui-focus-offset-invert"),
outline: "2px solid var(--calcite-color-danger)",
"outline-offset": invert("-2px", "--calcite-offset-invert-focus"),
},
".transition-default": {
transition: "all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s",
Expand Down
8 changes: 4 additions & 4 deletions packages/calcite-components/conventions/Styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To make this work, inside a component's SASS file, _you must use colors from the

// 👍 using the CSS var will inherit correctly
:host {
color: var(--calcite-ui-brand);
color: var(--calcite-color-brand);
}
```

Expand All @@ -63,23 +63,23 @@ Since Calcite Components might be used in many different contexts such as config

```css
:root {
--calcite-ui-brand: red;
--calcite-color-brand: red;
}
```

You can apply these overrides to individual components as well:

```css
calcite-slider {
--calcite-ui-brand: red;
--calcite-color-brand: red;
}
```

Or, add a class to the specific instance:

```css
.my-custom-theme {
--calcite-ui-brand: red;
--calcite-color-brand: red;
}
```

Expand Down
Loading
Loading