mirror of
https://github.com/material-components/material-web.git
synced 2026-03-09 00:09:23 +08:00
BREAKING CHANGE: Rename `@material/web/divider/lib` to `@material/web/divider/internal`. Prefer not using internal files. PiperOrigin-RevId: 550044361
65 lines
1.2 KiB
SCSS
65 lines
1.2 KiB
SCSS
//
|
|
// Copyright 2023 Google LLC
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
// go/keep-sorted start
|
|
@use 'sass:list';
|
|
// go/keep-sorted end
|
|
// go/keep-sorted start
|
|
@use '../../tokens';
|
|
// go/keep-sorted end
|
|
|
|
@mixin theme($tokens) {
|
|
$supported-tokens: tokens.$md-comp-divider-supported-tokens;
|
|
|
|
@each $token, $value in $tokens {
|
|
@if list.index($supported-tokens, $token) == null {
|
|
@error 'Token `#{$token}` is not a supported token.';
|
|
}
|
|
|
|
@if $value {
|
|
--md-divider-#{$token}: #{$value};
|
|
}
|
|
}
|
|
}
|
|
|
|
@mixin styles() {
|
|
$tokens: tokens.md-comp-divider-values();
|
|
|
|
:host {
|
|
@each $token, $value in $tokens {
|
|
--_#{$token}: var(--md-divider-#{$token}, #{$value});
|
|
}
|
|
|
|
box-sizing: border-box;
|
|
color: var(--_color);
|
|
display: flex;
|
|
height: var(--_thickness);
|
|
width: 100%;
|
|
}
|
|
|
|
:host([inset]),
|
|
:host([inset-start]) {
|
|
padding-inline-start: 16px;
|
|
}
|
|
|
|
:host([inset]),
|
|
:host([inset-end]) {
|
|
padding-inline-end: 16px;
|
|
}
|
|
|
|
:host::before {
|
|
background: currentColor;
|
|
content: '';
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
|
|
@media (forced-colors: active) {
|
|
:host::before {
|
|
background: CanvasText;
|
|
}
|
|
}
|
|
}
|