mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 13:17:00 +04:00
182 lines
3.8 KiB
SCSS
182 lines
3.8 KiB
SCSS
@use 'sass:map';
|
|
|
|
@use '../config' as *;
|
|
|
|
@keyframes status-pulsate-main {
|
|
40% {
|
|
transform: scale(1.25, 1.25);
|
|
}
|
|
60% {
|
|
transform: scale(1.25, 1.25);
|
|
}
|
|
}
|
|
|
|
@keyframes status-pulsate-secondary {
|
|
10% {
|
|
transform: scale(1, 1);
|
|
}
|
|
30% {
|
|
transform: scale(3, 3);
|
|
}
|
|
80% {
|
|
transform: scale(3, 3);
|
|
}
|
|
100% {
|
|
transform: scale(1, 1);
|
|
}
|
|
}
|
|
|
|
@keyframes status-pulsate-tertiary {
|
|
25% {
|
|
transform: scale(1, 1);
|
|
}
|
|
80% {
|
|
opacity: 0;
|
|
transform: scale(3, 3);
|
|
}
|
|
100% {
|
|
opacity: 0;
|
|
transform: scale(3, 3);
|
|
}
|
|
}
|
|
|
|
//
|
|
// Status
|
|
//
|
|
// stylelint-disable custom-property-no-missing-var-function -- token-map keys are dashed-idents by design, not unwrapped var() references
|
|
|
|
// scss-docs-start status-css-vars
|
|
$status-tokens: () !default;
|
|
$status-tokens: defaults(
|
|
(
|
|
--status-height: $status-height,
|
|
--status-color: $text-secondary,
|
|
--status-padding-y: $status-padding-y,
|
|
--status-padding-x: $status-padding-x,
|
|
--status-gap: $status-gap,
|
|
),
|
|
$status-tokens
|
|
);
|
|
// scss-docs-end status-css-vars
|
|
|
|
// stylelint-enable custom-property-no-missing-var-function
|
|
|
|
.status {
|
|
@include tokens($status-tokens);
|
|
display: inline-flex;
|
|
gap: var(--status-gap);
|
|
align-items: center;
|
|
height: var(--status-height);
|
|
padding: var(--status-padding-y) var(--status-padding-x);
|
|
margin: 0;
|
|
font-size: $font-size-base;
|
|
font-weight: var(--font-weight-medium);
|
|
line-height: 1;
|
|
color: var(--status-color);
|
|
text-transform: none;
|
|
letter-spacing: normal;
|
|
background: color-transparent(var(--status-color), 0.1);
|
|
@include border-radius(var(--border-radius-pill));
|
|
|
|
.status-dot {
|
|
background: var(--status-color);
|
|
}
|
|
|
|
.icon {
|
|
font-size: $status-icon-size;
|
|
}
|
|
}
|
|
|
|
.status-lite {
|
|
color: var(--body-color) !important;
|
|
background: transparent !important;
|
|
border: var(--border-width) var(--border-style) var(--border-color) !important;
|
|
}
|
|
|
|
@each $name, $color in map.merge($theme-colors, $social-colors) {
|
|
.status-#{$name} {
|
|
--status-color: var(--#{$name});
|
|
}
|
|
}
|
|
|
|
//
|
|
// Status dot
|
|
//
|
|
.status-dot {
|
|
--status-dot-color: var(--status-color, #{$text-secondary});
|
|
--status-size: #{$status-dot-size};
|
|
position: relative;
|
|
display: inline-block;
|
|
width: var(--status-size);
|
|
height: var(--status-size);
|
|
background: var(--status-dot-color);
|
|
@include border-radius(var(--border-radius-pill));
|
|
}
|
|
|
|
.status-dot-animated {
|
|
&::before {
|
|
position: absolute;
|
|
inset: 0;
|
|
z-index: 0;
|
|
content: '';
|
|
background: inherit;
|
|
border-radius: inherit;
|
|
opacity: 0.6;
|
|
animation: 1s linear 2s backwards infinite status-pulsate-tertiary;
|
|
}
|
|
}
|
|
|
|
//
|
|
// Status indicator
|
|
//
|
|
.status-indicator {
|
|
--status-indicator-size: #{$status-indicator-size};
|
|
--status-indicator-color: var(--status-color, #{$text-secondary});
|
|
position: relative;
|
|
display: block;
|
|
width: var(--status-indicator-size);
|
|
height: var(--status-indicator-size);
|
|
}
|
|
|
|
.status-indicator-circle {
|
|
--status-circle-size: #{$status-circle-size};
|
|
position: absolute;
|
|
inset-inline-start: 50%;
|
|
top: 50%;
|
|
width: var(--status-circle-size);
|
|
height: var(--status-circle-size);
|
|
margin: calc(var(--status-circle-size) / -2) 0 0 calc(var(--status-circle-size) / -2);
|
|
background: var(--status-color);
|
|
@include border-radius(var(--border-radius-pill));
|
|
|
|
&:nth-child(1) {
|
|
z-index: 3;
|
|
}
|
|
|
|
&:nth-child(2) {
|
|
z-index: 2;
|
|
opacity: 0.1;
|
|
}
|
|
|
|
&:nth-child(3) {
|
|
z-index: 1;
|
|
opacity: 0.3;
|
|
}
|
|
}
|
|
|
|
.status-indicator-animated {
|
|
.status-indicator-circle {
|
|
&:nth-child(1) {
|
|
animation: 2s linear 1s infinite backwards status-pulsate-main;
|
|
}
|
|
|
|
&:nth-child(2) {
|
|
animation: 2s linear 1s infinite backwards status-pulsate-secondary;
|
|
}
|
|
|
|
&:nth-child(3) {
|
|
animation: 2s linear 1s infinite backwards status-pulsate-tertiary;
|
|
}
|
|
}
|
|
}
|