UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

200 lines (168 loc) 3.43 kB
/* 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]) .track { width: 1.5rem; height: 0.75rem; } :host([scale=s]) .handle { width: 0.5rem; height: 0.5rem; } :host([scale=m]) .track { width: 2rem; height: 1rem; } :host([scale=m]) .handle { width: 0.75rem; height: 0.75rem; } :host([scale=l]) .track { width: 3rem; height: 1.5rem; } :host([scale=l]) .handle { width: 1.25rem; height: 1.25rem; } :host { display: inline-block; position: relative; width: auto; cursor: pointer; -webkit-user-select: none; -ms-user-select: none; user-select: none; vertical-align: middle; tap-highlight-color: transparent; } :host([disabled]) { opacity: var(--calcite-ui-opacity-disabled); pointer-events: none; cursor: default; } :host { outline-offset: 0; outline-color: transparent; transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out; width: auto; } :host(:focus) { outline: 2px solid var(--calcite-ui-brand); outline-offset: 2px; } .track { position: relative; display: inline-block; vertical-align: top; background-color: var(--calcite-ui-foreground-2); border-width: 1px; border-style: solid; border-color: var(--calcite-ui-border-2); box-sizing: border-box; pointer-events: none; transition-property: all; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); border-radius: 9999px; } .handle { position: absolute; display: block; right: auto; background-color: var(--calcite-ui-foreground-1); border-width: 2px; border-style: solid; border-color: var(--calcite-ui-border-input); transition-property: all; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); border-radius: 9999px; pointer-events: none; top: -1px; left: -1px; } :host(:hover) .handle, :host(:focus) .handle { border-color: var(--calcite-ui-brand); box-shadow: 0 0 0 1px var(--calcite-ui-brand); right: auto; } :host([switched]) .track { background-color: var(--calcite-ui-brand); border-color: var(--calcite-ui-brand); } :host([switched]) .handle { left: auto; border-color: var(--calcite-ui-brand); right: -1px; } :host([switched]:hover) .track { background-color: var(--calcite-ui-brand); border-color: var(--calcite-ui-brand); } :host([switched]:hover) .handle { border-color: var(--calcite-ui-brand); box-shadow: 0 0 0 1px var(--calcite-ui-brand); } .calcite--rtl .handle { left: auto; right: -1px; } :host([switched]) .calcite--rtl .handle { right: auto; left: -1px; } :host([switched]:active) .calcite--rtl .handle { right: auto; left: -1px; } :host([switched]:focus) .calcite--rtl .handle { right: auto; left: -1px; }