@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
123 lines (102 loc) • 2.27 kB
CSS
/* mixins & extensions */
@keyframes in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes in-down {
0% {
opacity: 0;
transform: translate3D(0, -5px, 0);
}
100% {
opacity: 1;
transform: translate3D(0, 0, 0);
}
}
@keyframes in-up {
0% {
opacity: 0;
transform: translate3D(0, 5px, 0);
}
100% {
opacity: 1;
transform: translate3D(0, 0, 0);
}
}
@keyframes in-scale {
0% {
opacity: 0;
transform: scale3D(0.95, 0.95, 1);
}
100% {
opacity: 1;
transform: scale3D(1, 1, 1);
}
}
/**
* Currently only used in Checkbox.
*/
:root {
--calcite-popper-transition: 150ms ease-in-out;
}
:host([hidden]) {
display: none;
}
:host([scale=s]) {
--calcite-checkbox-size: 0.75rem;
}
:host([scale=m]) {
--calcite-checkbox-size: var(--calcite-font-size--1);
}
:host([scale=l]) {
--calcite-checkbox-size: 1rem;
}
:host {
display: inline-flex;
cursor: pointer;
position: relative;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
:host .check-svg {
overflow: hidden;
display: inline-block;
background-color: var(--calcite-ui-foreground-1);
pointer-events: none;
box-sizing: border-box;
transition-property: all;
transition-duration: 150ms;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
width: var(--calcite-checkbox-size);
height: var(--calcite-checkbox-size);
box-shadow: inset 0 0 0 1px var(--calcite-ui-border-input);
fill: var(--calcite-ui-background);
}
:host ::slotted(input) {
width: var(--calcite-checkbox-size);
height: var(--calcite-checkbox-size);
}
:host(:hover) .check-svg,
:host([hovered]) .check-svg {
box-shadow: inset 0 0 0 2px var(--calcite-ui-brand);
}
:host([checked]) .check-svg,
:host([indeterminate]) .check-svg {
background-color: var(--calcite-ui-brand);
box-shadow: 0 0 0 1px var(--calcite-ui-brand);
}
:host .focused .check-svg {
box-shadow: inset 0 0 0 1px var(--calcite-ui-brand), 0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);
transition: 150ms ease-in-out;
}
:host([disabled]) {
cursor: default;
opacity: var(--calcite-ui-opacity-disabled);
pointer-events: none;
}