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

Commit

Permalink
feat(tabs): Switched theming to custom properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomheller committed Dec 2, 2020
1 parent 253e192 commit e8e7484
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 46 deletions.
10 changes: 2 additions & 8 deletions libs/barista-components/tabs/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_sass//:defs.bzl", "multi_sass_binary", "sass_library")
load("@io_bazel_rules_sass//:defs.bzl", "multi_sass_binary")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("//tools/bazel_rules:index.bzl", "jest", "ng_module_view_engine", "stylelint")

Expand Down Expand Up @@ -45,17 +45,11 @@ ng_module_view_engine(
],
)

sass_library(
name = "theme",
srcs = ["src/_tab-group-theme.scss"],
)

multi_sass_binary(
name = "styles",
srcs = [
"src/tab-group.scss",
"src/tab/tab-body.scss",
":theme",
],
)

Expand All @@ -75,9 +69,9 @@ jest(
"//libs/barista-components/core:compile",
"//libs/testing/browser",
"@npm//@angular/common",
"@npm//@angular/router",
"@npm//@angular/core",
"@npm//@angular/platform-browser",
"@npm//@angular/router",
"@npm//rxjs",
],
)
Expand Down
32 changes: 0 additions & 32 deletions libs/barista-components/tabs/src/_tab-group-theme.scss

This file was deleted.

30 changes: 24 additions & 6 deletions libs/barista-components/tabs/src/tab-group.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
@import '../../style/font-mixins';
@import '../../core/src/style/variables';
@import '../../core/src/theming/theming';
@import './tab-group-theme';
@import '../../core/src/style/interactive-common';

:host .dt-color-main {
--dt-tabgroup-default-color: var(--dt-theme-main-default-color);
}

:host .dt-color-recovered {
--dt-tabgroup-default-color: var(--dt-recovered-default-color);
&.dt-tab-label {
color: var(--dt-tabgroup-default-color);
}
}

:host .dt-color-error {
--dt-tabgroup-default-color: var(--dt-error-default-color);
&.dt-tab-label {
color: var(--dt-tabgroup-default-color);
}
}

:host .dt-tab-header-wrapper {
display: flex;
}
Expand Down Expand Up @@ -37,12 +53,18 @@
bottom: 0;
left: 0;
transition: height 100ms ease-out;
background-color: var(--dt-tabgroup-default-color);
}

&:hover::after {
height: 4px;
}

&.dt-tab-label-active {
background-color: var(--dt-tabgroup-default-color);
color: #ffffff;
}

@include dt-cdkmonitor-focus-style();

/** disabled
Expand All @@ -63,7 +85,3 @@
}
}
}

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

0 comments on commit e8e7484

Please sign in to comment.