Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
feat(progress-circle): Switched theming to custom properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomheller authored and ffriedl89 committed Jul 27, 2020
1 parent bbaae5b commit 017921d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
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);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@import '../../style/font-mixins';
@import '../../core/src/style/variables';
@import '../../core/src/theming/theming';
@import './progress-circle-theme';

:host {
display: inline-block;
Expand Down Expand Up @@ -48,7 +45,4 @@
}
}

// Apply the progress-circle theme to all theme definitions
@include dt-apply-theme() {
@include dt-theme-progress-circle($dt-current-theme);
}
@import './progress-circle-theme';

0 comments on commit 017921d

Please sign in to comment.