shoelace/src/components/badge/badge.styles.ts

95 wiersze
2.1 KiB
TypeScript
Czysty Zwykły widok Historia

2021-07-10 00:45:44 +00:00
import { css } from 'lit';
import componentStyles from '../../styles/component.styles';
export default css`
${componentStyles}
:host {
display: inline-flex;
}
.badge {
display: inline-flex;
align-items: center;
justify-content: center;
font-size: var(--sl-font-size-x-small);
font-weight: var(--sl-font-weight-semibold);
letter-spacing: var(--sl-letter-spacing-normal);
line-height: 1;
border-radius: var(--sl-border-radius-small);
2021-09-29 12:35:43 +00:00
border: solid 1px rgb(var(--sl-color-neutral-0));
2021-07-10 00:45:44 +00:00
white-space: nowrap;
padding: 3px 6px;
user-select: none;
cursor: inherit;
}
/* Type modifiers */
.badge--primary {
2021-08-18 21:54:35 +00:00
background-color: rgb(var(--sl-color-primary-600));
2021-08-25 21:48:37 +00:00
color: rgb(var(--sl-color-neutral-0));
2021-07-10 00:45:44 +00:00
}
.badge--success {
2021-08-18 21:54:35 +00:00
background-color: rgb(var(--sl-color-success-600));
2021-08-25 21:48:37 +00:00
color: rgb(var(--sl-color-neutral-0));
2021-07-10 00:45:44 +00:00
}
2021-08-06 12:32:46 +00:00
.badge--neutral {
2021-08-18 21:54:35 +00:00
background-color: rgb(var(--sl-color-neutral-600));
2021-08-25 21:48:37 +00:00
color: rgb(var(--sl-color-neutral-0));
2021-07-10 00:45:44 +00:00
}
.badge--warning {
2021-08-18 21:54:35 +00:00
background-color: rgb(var(--sl-color-warning-600));
2021-08-25 21:48:37 +00:00
color: rgb(var(--sl-color-neutral-0));
2021-07-10 00:45:44 +00:00
}
.badge--danger {
2021-08-18 21:54:35 +00:00
background-color: rgb(var(--sl-color-danger-600));
2021-08-25 21:48:37 +00:00
color: rgb(var(--sl-color-neutral-0));
2021-07-10 00:45:44 +00:00
}
/* Pill modifier */
.badge--pill {
border-radius: var(--sl-border-radius-pill);
}
/* Pulse modifier */
.badge--pulse {
animation: pulse 1.5s infinite;
}
.badge--pulse.badge--primary {
2021-08-18 21:54:35 +00:00
--pulse-color: rgb(var(--sl-color-primary-600));
2021-07-10 00:45:44 +00:00
}
.badge--pulse.badge--success {
2021-08-18 21:54:35 +00:00
--pulse-color: rgb(var(--sl-color-success-600));
2021-07-10 00:45:44 +00:00
}
2021-08-06 12:32:46 +00:00
.badge--pulse.badge--neutral {
2021-08-18 21:54:35 +00:00
--pulse-color: rgb(var(--sl-color-neutral-600));
2021-07-10 00:45:44 +00:00
}
.badge--pulse.badge--warning {
2021-08-18 21:54:35 +00:00
--pulse-color: rgb(var(--sl-color-warning-600));
2021-07-10 00:45:44 +00:00
}
.badge--pulse.badge--danger {
2021-08-18 21:54:35 +00:00
--pulse-color: rgb(var(--sl-color-danger-600));
2021-07-10 00:45:44 +00:00
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 var(--pulse-color);
}
70% {
box-shadow: 0 0 0 0.5rem transparent;
}
100% {
box-shadow: 0 0 0 0 transparent;
}
}
`;