This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(progress-circle): Switched theming to custom properties.
- Loading branch information
Showing
2 changed files
with
21 additions
and
25 deletions.
There are no files selected for viewing
38 changes: 20 additions & 18 deletions
38
libs/barista-components/progress-circle/src/_progress-circle-theme.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
@import '../../core/src/theming/theming'; | ||
|
||
@mixin dt-theme-progress-circle($theme) { | ||
$palette-names: 'main', 'accent', 'warning', 'recovered', 'error'; | ||
$default-palette: 'main'; | ||
|
||
@each $name in $palette-names { | ||
$is-dark: map-get($theme, 'is-dark'); | ||
$palette: dt-get-theme-palette($theme, $name); | ||
$default-color: dt-get-theme-color($palette, 'default'); | ||
:host.dt-color-main { | ||
--dt-progress-circle-color: var(--dt-theme-main-default-color); | ||
} | ||
:host.dt-color-accent { | ||
--dt-progress-circle-color: var(--dt-accent-default-color); | ||
} | ||
:host.dt-color-warning { | ||
--dt-progress-circle-color: var(--dt-warning-default-color); | ||
} | ||
:host.dt-color-recovered { | ||
--dt-progress-circle-color: var(--dt-recovered-default-color); | ||
} | ||
:host.dt-color-error { | ||
--dt-progress-circle-color: var(--dt-error-default-color); | ||
} | ||
|
||
$namespace: ':host'; | ||
@if $name != $default-palette { | ||
$namespace: ':host.dt-color-#{$name}'; | ||
} | ||
.dt-theme-dark :host { | ||
color: #ffffff; | ||
} | ||
|
||
#{$namespace} .dt-progress-circle-progress { | ||
stroke: $default-color; | ||
} | ||
} | ||
:host .dt-progress-circle-progress { | ||
stroke: var(--dt-progress-circle-color); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters