Skip to content

Commit

Permalink
feat(theme): added surface-inverse and on-surface-inverse colors
Browse files Browse the repository at this point in the history
  • Loading branch information
DRiFTy17 committed Oct 25, 2023
1 parent 9a1f4e0 commit a4fb3bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/dev/pages/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const SWATCH_GROUPS: ISwatchGroup[] = [
swatches: [
{ text: 'Surface', background: 'surface' },
{ text: 'Surface dim (background)', background: 'surface-dim' },
{ text: 'Surface bright', background: 'surface-bright' }
{ text: 'Surface bright', background: 'surface-bright' },
{ text: 'Surface inverse', background: 'surface-inverse', foreground: 'on-surface-inverse' }
]
},
{
Expand Down
4 changes: 3 additions & 1 deletion src/lib/core/styles/tokens/theme/_color-emphasis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ $color-emphasis-scale: (
'060': 60%,
'065': 65%,
'070': 70%,
'087': 87%,
'080': 80%,
'087': 87%
);

$color-emphasis: (
highest: map.get($color-emphasis-scale, '087'),
inverse: map.get($color-emphasis-scale, '080'),
higher: map.get($color-emphasis-scale, '070'),
high: map.get($color-emphasis-scale, '065'),
medium-high: map.get($color-emphasis-scale, '060'),
Expand Down
3 changes: 3 additions & 0 deletions src/lib/core/styles/tokens/theme/_tokens.surface.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
$surface: map.get($theme, surface);
$on-surface: theme-utils.contrast($surface);
$surface-tone: color-utils.tone($surface);
$surface-inverse: theme-utils.hexify($on-surface, $surface, color-emphasis.value(inverse));

$surface-container: theme-utils.hexify($on-surface, $surface, color-emphasis.value(lower));
$surface-container-low: theme-utils.hexify($on-surface, $surface, color-emphasis.value(lowest));
Expand All @@ -23,6 +24,7 @@

@return (
surface: $surface,
surface-inverse: $surface-inverse,
surface-container: $surface-container,
surface-container-low: $surface-container-low,
surface-container-medium: $surface-container-medium,
Expand All @@ -31,6 +33,7 @@
surface-bright: map.get($theme, surface-bright),
surface-bright-shadow: map.get($theme, surface-bright-shadow),
on-surface: $on-surface,
on-surface-inverse: theme-utils.contrast($surface-inverse),
on-surface-container: theme-utils.contrast($surface-container),
on-surface-container-low: theme-utils.contrast($surface-container-low),
on-surface-container-medium: theme-utils.contrast($surface-container-medium),
Expand Down

0 comments on commit a4fb3bf

Please sign in to comment.