Skip to content

Commit f7b09f4

Browse files
committed
feat(design-tokens): add elevation tokens
1 parent 0b90abd commit f7b09f4

File tree

21 files changed

+290
-58
lines changed

21 files changed

+290
-58
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@twilio-paste/design-tokens": minor
3+
---
4+
5+
[Design Tokens] Update aliases and add new tokens for elevation foundations

packages/paste-core/primitives/box/type-docs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@
727727
"description": "Responsive prop for the CSS `background-attachment` property"
728728
},
729729
"backgroundColor": {
730-
"type": "\"inherit\" | \"none\" | \"colorBackground\" | \"colorBackgroundAvailable\" | \"colorBackgroundBody\" | \"colorBackgroundBodyInverse\" | \"colorBackgroundBrand\" | \"colorBackgroundBrand10\" | ... 56 more ... | { ...; }",
730+
"type": "\"inherit\" | \"none\" | \"colorBackground\" | \"colorBackgroundAvailable\" | \"colorBackgroundBody\" | \"colorBackgroundBodyElevation\" | \"colorBackgroundBodyInverse\" | \"colorBackgroundBrand\" | ... 64 more ... | { ...; }",
731731
"defaultValue": null,
732732
"required": false,
733733
"externalProp": false,
@@ -958,7 +958,7 @@
958958
"description": "Responsive prop for the CSS `bottom` property"
959959
},
960960
"boxShadow": {
961-
"type": "\"none\" | \"shadow\" | \"shadowBorder\" | \"shadowBorderBottomBrand10Strong\" | \"shadowBorderBottomBrand20Strong\" | \"shadowBorderBottomBrand30Strong\" | \"shadowBorderBottomDecorative10Weaker\" | ... 75 more ... | { ...; }",
961+
"type": "\"none\" | \"shadow\" | \"shadowBorder\" | \"shadowBorderBottomBrand10Strong\" | \"shadowBorderBottomBrand20Strong\" | \"shadowBorderBottomBrand30Strong\" | \"shadowBorderBottomDecorative10Weaker\" | ... 84 more ... | { ...; }",
962962
"defaultValue": null,
963963
"required": false,
964964
"externalProp": false,

packages/paste-core/primitives/sibling-box/type-docs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@
829829
"description": "Responsive prop for the CSS `background-attachment` property"
830830
},
831831
"backgroundColor": {
832-
"type": "\"inherit\" | \"none\" | \"colorBackground\" | \"colorBackgroundAvailable\" | \"colorBackgroundBody\" | \"colorBackgroundBodyInverse\" | \"colorBackgroundBrand\" | \"colorBackgroundBrand10\" | ... 56 more ... | { ...; }",
832+
"type": "\"inherit\" | \"none\" | \"colorBackground\" | \"colorBackgroundAvailable\" | \"colorBackgroundBody\" | \"colorBackgroundBodyElevation\" | \"colorBackgroundBodyInverse\" | \"colorBackgroundBrand\" | ... 64 more ... | { ...; }",
833833
"defaultValue": null,
834834
"required": false,
835835
"externalProp": false,
@@ -1060,7 +1060,7 @@
10601060
"description": "Responsive prop for the CSS `bottom` property"
10611061
},
10621062
"boxShadow": {
1063-
"type": "\"none\" | \"shadow\" | \"shadowBorder\" | \"shadowBorderBottomBrand10Strong\" | \"shadowBorderBottomBrand20Strong\" | \"shadowBorderBottomBrand30Strong\" | \"shadowBorderBottomDecorative10Weaker\" | ... 75 more ... | { ...; }",
1063+
"type": "\"none\" | \"shadow\" | \"shadowBorder\" | \"shadowBorderBottomBrand10Strong\" | \"shadowBorderBottomBrand20Strong\" | \"shadowBorderBottomBrand30Strong\" | \"shadowBorderBottomDecorative10Weaker\" | ... 84 more ... | { ...; }",
10641064
"defaultValue": null,
10651065
"required": false,
10661066
"externalProp": false,

packages/paste-core/primitives/text/type-docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@
531531
"description": "Responsive prop for the CSS `bottom` property"
532532
},
533533
"boxShadow": {
534-
"type": "\"none\" | \"shadow\" | \"shadowBorder\" | \"shadowBorderBottomBrand10Strong\" | \"shadowBorderBottomBrand20Strong\" | \"shadowBorderBottomBrand30Strong\" | \"shadowBorderBottomDecorative10Weaker\" | ... 75 more ... | { ...; }",
534+
"type": "\"none\" | \"shadow\" | \"shadowBorder\" | \"shadowBorderBottomBrand10Strong\" | \"shadowBorderBottomBrand20Strong\" | \"shadowBorderBottomBrand30Strong\" | \"shadowBorderBottomDecorative10Weaker\" | ... 84 more ... | { ...; }",
535535
"defaultValue": null,
536536
"required": false,
537537
"externalProp": false,

packages/paste-design-tokens/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 97 additions & 12 deletions
Large diffs are not rendered by default.

packages/paste-design-tokens/tokens/aliases/color-palette.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,19 @@ aliases:
2929
palette-gray-0: "#ffffff"
3030
palette-gray-05: "#f9f9fa"
3131
palette-gray-10: "#f4f4f6"
32+
palette-gray-15: "#edeef2"
3233
palette-gray-20: "#e1e3ea"
3334
palette-gray-30: "#cacdd8"
34-
palette-gray-40: "#aeb2c1"
35+
palette-gray-40: "#8e96ae"
3536
palette-gray-50: "#8891aa"
37+
palette-gray-55: "#67728e"
3638
palette-gray-60: "#606b85"
3739
palette-gray-70: "#4b5671"
40+
palette-gray-75: "#404f6e"
3841
palette-gray-80: "#394762"
42+
palette-gray-85: "#25395b"
3943
palette-gray-90: "#1f304c"
44+
palette-gray-95: "#17243a"
4045
palette-gray-100: "#121c2d"
4146
palette-gray-110: "#0F1621"
4247

@@ -52,7 +57,8 @@ aliases:
5257
palette-gray-0-transparent-90: "rgba(255, 255, 255, 0.9)"
5358
palette-gray-0-transparent-100: "rgba(255, 255, 255, 1)"
5459

55-
## Grays transparent based on darkest gray
60+
## Grays transparent based on dark gray
61+
palette-gray-100-transparent-05: "rgba(18, 28, 45, 0.05)"
5662
palette-gray-100-transparent-10: "rgba(18, 28, 45, 0.1)"
5763
palette-gray-100-transparent-20: "rgba(18, 28, 45, 0.2)"
5864
palette-gray-100-transparent-30: "rgba(18, 28, 45, 0.3)"
@@ -64,6 +70,10 @@ aliases:
6470
palette-gray-100-transparent-90: "rgba(18, 28, 45, 0.9)"
6571
palette-gray-100-transparent-100: "rgba(18, 28, 45, 1)"
6672

73+
## Grays transparent based on darkest gray
74+
palette-gray-110-transparent-05: "rgba(15,22,33 0.05)"
75+
palette-gray-110-transparent-10: "rgba(15,22,33 0.1)"
76+
6777
## Blues transparent based on darkest blue
6878
palette-blue-100-transparent-10: "rgba(6, 3, 58, 0.1)"
6979
palette-blue-100-transparent-20: "rgba(6, 3, 58, 0.2)"

packages/paste-design-tokens/tokens/aliases/color.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ aliases:
1111
sun: "#FF7A00"
1212
white: "#FFFFFF"
1313
white-accent: "#F6FBFE"
14-
black-transparent-40: "rgba(0, 0, 0, 0.4)"
14+
palette-black-transparent-40: "rgba(0, 0, 0, 0.4)"

packages/paste-design-tokens/tokens/aliases/offset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ aliases:
1414
offset-90: "32px"
1515
offset-negative-05: -1px
1616
offset-negative-20: -4px
17+
offset-negative-60: -16px

packages/paste-design-tokens/tokens/global/background-color.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ props:
3333
color-background-weak:
3434
value: "{!palette-gray-05}"
3535
comment: Weak background color used for containers.
36+
color-background-weaker:
37+
value: "{!palette-gray-0}"
38+
comment: Weaker background color used for containers.
3639

3740
# brand backgrounds
3841
color-background-brand:
@@ -210,3 +213,26 @@ props:
210213
color-background-notification:
211214
value: "{!palette-red-60}"
212215
comment: Background color used for notifications.
216+
217+
#elevation background
218+
color-background-body-elevation:
219+
value: "{!palette-gray-05}"
220+
comment: Elevation token for color-background-body elements.
221+
color-background-weak-elevation:
222+
value: "{!palette-gray-05}"
223+
comment: Elevation token for color-background-weak elements.
224+
color-background-elevation:
225+
value: "{!palette-gray-15}"
226+
comment: Elevation token for color-background elements.
227+
color-background-inverse-elevation:
228+
value: "{!palette-gray-95}"
229+
comment: Elevation token for color-background-inverse elements.
230+
color-background-inverse-weak-elevation:
231+
value: "{!palette-gray-85}"
232+
comment: Elevation token for color-background-inverse-weak elements.
233+
color-background-inverse-strong-elevation:
234+
value: "{!palette-gray-75}"
235+
comment: Elevation token for color-background-inverse-strong elements.
236+
color-background-inverse-stronger-elevation:
237+
value: "{!palette-gray-75}"
238+
comment: Elevation token for color-background-inverse-stronger elements.

packages/paste-design-tokens/tokens/global/box-shadow.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,40 @@ props:
250250
value: "{!offset-20} {!offset-0} {!offset-40} {!offset-negative-20} {!palette-gray-100-transparent-20}"
251251
comment: Left shadow border for elements.
252252
shadow-left-inverse:
253-
value: "{!offset-20} {!offset-0} {!offset-40} {!offset-negative-20} {!black-transparent-40}"
253+
value: "{!offset-20} {!offset-0} {!offset-40} {!offset-negative-20} {!palette-black-transparent-40}"
254254
comment: Left shadow border for inverse elements.
255255
shadow-right:
256256
value: "{!offset-negative-20} {!offset-0} {!offset-40} {!offset-negative-20} {!palette-gray-100-transparent-20}"
257257
comment: Right shadow border for elements.
258258
shadow-right-inverse:
259-
value: "{!offset-negative-20} {!offset-0} {!offset-40} {!offset-negative-20} {!black-transparent-40}"
259+
value: "{!offset-negative-20} {!offset-0} {!offset-40} {!offset-negative-20} {!palette-black-transparent-40}"
260260
comment: Right shadow border for inverse elements.
261+
262+
# Elevation
263+
shadow-elevation-05:
264+
value: "{!offset-0} {!offset-0} {!offset-0} {!offset-05} {!palette-gray-15}"
265+
comment: Shadow border for elevation.
266+
shadow-elevation-top-05:
267+
value: "{!offset-0} {!offset-negative-05} {!offset-0} {!offset-0} {!palette-gray-15}"
268+
comment: Top shadow border for elevation.
269+
shadow-elevation-bottom-05:
270+
value: "{!offset-0} {!offset-05} {!offset-0} {!offset-0} {!palette-gray-15}"
271+
comment: Bottom shadow border for elevation.
272+
shadow-elevation-inverse-05:
273+
value: "{!offset-0} {!offset-0} {!offset-0} {!offset-05} {!palette-gray-90}"
274+
comment: Shadow border for inverse elevation.
275+
shadow-elevation-inverse-left-05:
276+
value: "{!offset-0} {!offset-05} {!offset-0} {!offset-0} {!palette-gray-90}"
277+
comment: Left shadow border for inverse elevation.
278+
shadow-elevation-10:
279+
value: "{!offset-0} {!offset-negative-05} {!offset-0} {!offset-0} {!palette-gray-10}, {!offset-0} {!offset-15} {!offset-20} {!offset-0} {!palette-gray-110-transparent-10}"
280+
comment: Shadow border for elevation.
281+
shadow-inverse-elevation-10:
282+
value: "{!offset-negative-05} {!offset-negative-05} {!offset-0} {!offset-0} {!palette-gray-90}, {!offset-0} {!offset-15} {!offset-20} {!offset-0} {!palette-gray-110-transparent-10}"
283+
comment: Shadow border for inverse elevation.
284+
shadow-elevation-20:
285+
value: "{!offset-0} {!offset-0} {!offset-0} {!offset-05} {!palette-gray-05}, {!offset-0} {!offset-30} {!offset-40} {!offset-0} {!palette-gray-100-transparent-05}, {!offset-60} {!offset-60} {!offset-90} {!offset-0} {!palette-gray-110-transparent-05}"
286+
comment: Shadow border for elevation.
287+
shadow-elevation-left-20:
288+
value: "{!offset-0} {!offset-0} {!offset-0} {!offset-05} {!palette-gray-05}, {!offset-negative-20} {!offset-0} {!offset-40} {!offset-0} {!palette-gray-100-transparent-05}, {!offset-negative-60} {!offset-0} {!offset-90} {!offset-0} {!palette-gray-110-transparent-05}"
289+
comment: Left shadow border for elevation.

0 commit comments

Comments
 (0)