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

Commit

Permalink
feat(bar-indicator): Changes styling to use custom properties
Browse files Browse the repository at this point in the history
  • Loading branch information
rowa-audil authored and ffriedl89 committed May 20, 2020
1 parent e33547a commit 193b3e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
27 changes: 11 additions & 16 deletions libs/barista-components/bar-indicator/src/_bar-indicator-theme.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
@import '../../core/src/theming/theming';

@mixin dt-theme-bar-indicator($theme) {
$palette-names: 'main', 'recovered', 'error';
$default-palette: 'main';
:host.dt-color-main {
--dt-bar-indicator-background-color: var(--dt-theme-main-default-color);
}

@each $name in $palette-names {
$palette: dt-get-theme-palette($theme, $name);
$default-color: dt-get-theme-color($palette, 'default');
:host.dt-color-error {
--dt-bar-indicator-background-color: var(--dt-error-default-color);
}

$namespace: ':host';
@if $name != $default-palette {
$namespace: ':host.dt-color-#{$name}';
}
:host.dt-color-recovered {
--dt-bar-indicator-background-color: var(--dt-recovered-default-color);
}

#{$namespace} .dt-bar-indicator-bar {
background-color: $default-color;
}
}
:host .dt-bar-indicator-bar {
background: var(--dt-bar-indicator-background-color);
}
6 changes: 0 additions & 6 deletions libs/barista-components/bar-indicator/src/bar-indicator.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import '../../core/src/style/variables';
@import '../../core/src/theming/theming';
@import './bar-indicator-theme';

:host {
Expand All @@ -22,7 +20,3 @@
left: auto;
right: 0;
}

@include dt-apply-theme() {
@include dt-theme-bar-indicator($dt-current-theme);
}

0 comments on commit 193b3e5

Please sign in to comment.