Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions scripts/convert-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,22 +254,22 @@ StyleDictionary.registerFormat({
makeColorUtility('chart-stroke', 'chart-stroke', 'stroke'),
].map((make) => make(colors))}
}

module.exports.elevationUtilities = {
${boxShadow
.map(
({ name }, index) =>
`'.elevation-${index}': {
'box-shadow': 'var(--${name})',
'background-color': 'var(--surface-${
'background-color': '${
index === 0
? 'default'
? 'var(--surface-default)'
: index === 1
? 'hover'
? '' // Elements like buttons that sit right on top of a surface that have their own background color
: index === 2
? 'secondary'
: 'tertiary'
})',
? 'var(--surface-raise)'
: 'var(--surface-secondary)'
}',
}`,
)
.join(',\n')}
Expand Down
3 changes: 1 addition & 2 deletions styles/dist/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@
--border-radius-full: 624.9375rem;

--elevation-0: none;
--elevation-1: 0px 0.656px 4.625px #00000021, 0px 3px 13px #00000033,
0px 7.594px 34.875px #00000045, 0px 15px 80px #00000066;
--elevation-1: 0px 1px 2px #00000099;
--elevation-2: 0px 2.188px 4.625px #00000021, 0px 10px 13px #00000033,
0px 25.313px 34.875px #00000045, 0px 50px 80px #00000066;
--elevation-3: 0px 4.375px 4.625px #00000021, 0px 20px 13px #00000033,
Expand Down
6 changes: 3 additions & 3 deletions styles/dist/tailwind-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -931,15 +931,15 @@ module.exports.elevationUtilities = {
},
'.elevation-1': {
'box-shadow': 'var(--elevation-1)',
'background-color': 'var(--surface-hover)',
'background-color': '',
},
'.elevation-2': {
'box-shadow': 'var(--elevation-2)',
'background-color': 'var(--surface-secondary)',
'background-color': 'var(--surface-raise)',
},
'.elevation-3': {
'box-shadow': 'var(--elevation-3)',
'background-color': 'var(--surface-tertiary)',
'background-color': 'var(--surface-secondary)',
},
}

Expand Down
212 changes: 94 additions & 118 deletions styles/src/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,99 @@
"value": "underline",
"type": "textDecoration"
}
},
"elevation": {
"0": {
"value": "none",
"type": "boxShadow"
},
"1": {
"value": [
{
"color": "rgba(0,0,0,0.6)",
"type": "dropShadow",
"x": "0",
"y": "1",
"blur": "2",
"spread": "0"
}
],
"type": "boxShadow"
},
"2": {
"value": [
{
"color": "#00000021",
"type": "dropShadow",
"x": "0",
"y": "2.1875",
"blur": "4.625",
"spread": "0"
},
{
"color": "#00000033",
"type": "dropShadow",
"x": "0",
"y": "10",
"blur": "13",
"spread": "0"
},
{
"color": "#00000045",
"type": "dropShadow",
"x": "0",
"y": "25.3125",
"blur": "34.875",
"spread": "0"
},
{
"color": "#00000066",
"type": "dropShadow",
"x": "0",
"y": "50",
"blur": "80",
"spread": "0"
}
],
"type": "boxShadow"
},
"3": {
"value": [
{
"color": "#00000021",
"type": "dropShadow",
"x": "0",
"y": "4.375",
"blur": "4.625",
"spread": "0"
},
{
"color": "#00000033",
"type": "dropShadow",
"x": "0",
"y": "20",
"blur": "13",
"spread": "0"
},
{
"color": "#00000045",
"type": "dropShadow",
"x": "0",
"y": "50.625",
"blur": "34.875",
"spread": "0"
},
{
"color": "#00000066",
"type": "dropShadow",
"x": "0",
"y": "100",
"blur": "80",
"spread": "0"
}
],
"type": "boxShadow"
}
}
},
"colors": {
Expand Down Expand Up @@ -649,123 +742,6 @@
"type": "color"
}
}
},
"elevation": {
"0": {
"value": "none",
"type": "boxShadow"
},
"1": {
"value": [
{
"color": "#00000021",
"type": "dropShadow",
"x": "0",
"y": "0.65625",
"blur": "4.625",
"spread": "0"
},
{
"color": "#00000033",
"type": "dropShadow",
"x": "0",
"y": "3",
"blur": "13",
"spread": "0"
},
{
"color": "#00000045",
"type": "dropShadow",
"x": "0",
"y": "7.59375",
"blur": "34.875",
"spread": "0"
},
{
"color": "#00000066",
"type": "dropShadow",
"x": "0",
"y": "15",
"blur": "80",
"spread": "0"
}
],
"type": "boxShadow"
},
"2": {
"value": [
{
"color": "#00000021",
"type": "dropShadow",
"x": "0",
"y": "2.1875",
"blur": "4.625",
"spread": "0"
},
{
"color": "#00000033",
"type": "dropShadow",
"x": "0",
"y": "10",
"blur": "13",
"spread": "0"
},
{
"color": "#00000045",
"type": "dropShadow",
"x": "0",
"y": "25.3125",
"blur": "34.875",
"spread": "0"
},
{
"color": "#00000066",
"type": "dropShadow",
"x": "0",
"y": "50",
"blur": "80",
"spread": "0"
}
],
"type": "boxShadow"
},
"3": {
"value": [
{
"color": "#00000021",
"type": "dropShadow",
"x": "0",
"y": "4.375",
"blur": "4.625",
"spread": "0"
},
{
"color": "#00000033",
"type": "dropShadow",
"x": "0",
"y": "20",
"blur": "13",
"spread": "0"
},
{
"color": "#00000045",
"type": "dropShadow",
"x": "0",
"y": "50.625",
"blur": "34.875",
"spread": "0"
},
{
"color": "#00000066",
"type": "dropShadow",
"x": "0",
"y": "100",
"blur": "80",
"spread": "0"
}
],
"type": "boxShadow"
}
}
},
"yellow-accent": {
Expand Down Expand Up @@ -2082,4 +2058,4 @@
"main"
]
}
}
}