mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
31 lines
701 B
SCSS
31 lines
701 B
SCSS
|
|
/* Keep class names in sync with ThemeService */
|
||
|
|
$_dark-theme-class: 'dark-theme';
|
||
|
|
$_light-theme-class: 'light-theme';
|
||
|
|
|
||
|
|
/* $browser expects 'chrome', 'firefox' or 'safari' */
|
||
|
|
@mixin _theme($theme, $browser: '') {
|
||
|
|
@if $browser == '' {
|
||
|
|
:host-context(body.#{$theme}) {
|
||
|
|
@content;
|
||
|
|
}
|
||
|
|
} @else {
|
||
|
|
/* Keep browser class name in sync with BrowserService. */
|
||
|
|
$browser-class: $browser + '-ui';
|
||
|
|
:host-context(body.#{$theme}.#{$browser-class}) {
|
||
|
|
@content;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
@mixin dark-theme($browser: '') {
|
||
|
|
@include _theme($_dark-theme-class, $browser) {
|
||
|
|
@content;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
@mixin light-theme($browser: '') {
|
||
|
|
@include _theme($_light-theme-class, $browser) {
|
||
|
|
@content;
|
||
|
|
}
|
||
|
|
}
|