UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

426 lines (377 loc) • 9.21 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-right { 0% { opacity: 0; transform: translate3D(-5px, 0, 0); } 100% { opacity: 1; transform: translate3D(0, 0, 0); } } @keyframes in-left { 0% { opacity: 0; transform: translate3D(5px, 0, 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); } } :root { --calcite-animation-timing: calc(150ms * var(--calcite-internal-duration-factor)); --calcite-internal-duration-factor: var(--calcite-duration-factor, 1); --calcite-internal-animation-timing-fast: calc(100ms * var(--calcite-internal-duration-factor)); --calcite-internal-animation-timing-medium: calc(200ms * var(--calcite-internal-duration-factor)); --calcite-internal-animation-timing-slow: calc(300ms * var(--calcite-internal-duration-factor)); } .calcite-animate { opacity: 0; animation-fill-mode: both; animation-duration: var(--calcite-animation-timing); } .calcite-animate__in { animation-name: in; } .calcite-animate__in-down { animation-name: in-down; } .calcite-animate__in-up { animation-name: in-up; } .calcite-animate__in-right { animation-name: in-right; } .calcite-animate__in-left { animation-name: in-left; } .calcite-animate__in-scale { animation-name: in-scale; } @media (prefers-reduced-motion: reduce) { :root { --calcite-internal-duration-factor: 0.01; } } /* helper to properly scale internal durations */ /** * Currently only used in Checkbox. */ :root { --calcite-floating-ui-transition: var(--calcite-animation-timing); --calcite-floating-ui-z-index: var(--calcite-app-z-index-dropdown); } :host([hidden]) { display: none; } :host([disabled]) { cursor: default; -webkit-user-select: none; user-select: none; opacity: var(--calcite-ui-opacity-disabled); } :host([disabled]) *, :host([disabled]) ::slotted(*) { pointer-events: none; } :host { display: block; flex: 0 1 auto; outline: 2px solid transparent; outline-offset: 2px; margin-inline-start: 0px; margin-inline-end: 1.25rem; } :host([layout=center][scale=s]), :host([layout=center][scale=m]), :host([layout=center][scale=l]) { margin-block: 0px; text-align: center; margin-inline-end: 0px; flex-basis: 12rem; } :host([layout=center][scale=s]) .content, :host([layout=center][scale=m]) .content, :host([layout=center][scale=l]) .content { margin: auto; } :host([layout=center][closable]) .content { padding-inline-start: 32px; } :host([layout=center][bordered][closable][scale=s]) .content { padding-inline-start: 36px; } :host([layout=center][bordered][closable][scale=m]) .content { padding-inline-start: 40px; } :host([layout=center][closable][scale=l]) .content { padding-inline-start: 40px; } :host([layout=center][closable][bordered][scale=l]) .content { padding-inline-start: 52px; } :host([position=bottom]) .container { border-block-end-width: 0px; border-block-start-width: 2px; border-block-start-color: transparent; border-block-start-style: solid; } :host([closed]) { display: none; } .container { outline-color: transparent; } :host(:focus) .container { outline: 2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand)); outline-offset: calc( -2px * calc( 1 - 2 * clamp( 0, var(--calcite-ui-focus-offset-invert), 1 ) ) ); } :host(:focus) .container:focus-within { outline-color: transparent; } :host(:active) a, :host(:focus) a, :host(:hover) a { border-color: var(--calcite-ui-border-2); color: var(--calcite-ui-text-1); text-decoration-line: none; } :host([selected]) .container { border-color: transparent; color: var(--calcite-ui-text-1); } :host([disabled]) .container { pointer-events: none; opacity: 0.5; } :host([disabled]) ::slotted([calcite-hydrated][disabled]), :host([disabled]) [calcite-hydrated][disabled] { /* prevent opacity stacking */ opacity: 1; } :host([scale=s]) { margin-inline-end: 1rem; } :host([scale=s]) .content { padding-block: 0.25rem; font-size: var(--calcite-font-size--2); line-height: 1rem; } :host([scale=m]) .content { padding-block: 0.5rem; font-size: var(--calcite-font-size--1); line-height: 1rem; } :host([scale=l]) { margin-inline-end: 1.5rem; } :host([scale=l]) .content { padding-block: 0.625rem; font-size: var(--calcite-font-size-0); line-height: 1.25rem; } .container { box-sizing: border-box; display: flex; block-size: 100%; inline-size: 100%; cursor: pointer; align-content: center; justify-content: space-between; border-block-end-width: 2px; padding-inline: 0px; font-size: var(--calcite-font-size--1); line-height: 1rem; color: var(--calcite-ui-text-3); transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s; border-block-end-color: transparent; border-block-end-style: solid; } .content { display: flex; align-items: center; justify-content: center; } .calcite-tab-title--icon { position: relative; margin: 0px; display: inline-flex; align-self: center; } .calcite-tab-title--icon svg { transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s; } .content--has-text { padding: 0.25rem; } .content--has-text .calcite-tab-title--icon.icon-start { margin-inline-end: 0.5rem; } .content--has-text .calcite-tab-title--icon.icon-end { margin-inline-start: 0.5rem; } .close-button { display: flex; cursor: pointer; -webkit-appearance: none; appearance: none; align-content: center; align-items: center; justify-content: center; align-self: center; border-style: none; background-color: var(--calcite-ui-foreground-1); color: var(--calcite-ui-text-3); outline-color: transparent; transition: all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s; block-size: calc(100% - 2px); background-color: var(--calcite-button-transparent-1); margin-inline-start: auto; } .close-button:focus { outline: 2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand)); outline-offset: calc( -2px * calc( 1 - 2 * clamp( 0, var(--calcite-ui-focus-offset-invert), 1 ) ) ); outline-offset: -1px; } .close-button:focus, .close-button:hover { color: var(--calcite-ui-text-1); background-color: var(--calcite-ui-foreground-2); } .close-button:active { color: var(--calcite-ui-text-1); background-color: var(--calcite-ui-foreground-3); } .close-button calcite-icon { color: inherit; } :host([icon-start][icon-end]) .calcite-tab-title--icon:first-child { margin-inline-end: 0.5rem; } :host([bordered]) { margin-inline-end: 0; } :host([bordered][selected]) { box-shadow: inset 0px -2px var(--calcite-ui-foreground-1); } :host([bordered][selected][position=bottom]) { box-shadow: inset 0 2px 0 var(--calcite-ui-foreground-1); } :host([bordered]:hover) .container, :host([bordered]:focus) .container, :host([bordered]:active) .container { position: relative; } :host([bordered]:hover) .container { background-color: var(--calcite-button-transparent-hover); } :host([closable]) .container, :host([bordered]) .container { border-inline-start: 1px solid transparent; border-inline-end: 1px solid transparent; } :host([closable]) .container .close-button, :host([bordered]) .container .close-button { margin-inline: 0; } :host([closable]) .content { box-sizing: border-box; block-size: 100%; border-block-end-color: transparent; } :host([closable][position=bottom]) .container, :host([bordered][position=bottom]) .container { border-block-start-style: unset; } :host([selected][bordered]) .container { border-inline-start-color: var(--calcite-ui-border-1); border-inline-end-color: var(--calcite-ui-border-1); } :host([bordered]) .content { padding-inline: 0.75rem; } :host([bordered][scale=s]) .content { padding-inline: 0.5rem; } :host([bordered][scale=l]) .content { padding-inline: 1rem; } @media (forced-colors: active) { :host { outline-width: 0; outline-offset: 0; } :host(:focus) .container { outline-color: highlight; } :host([bordered]) .container { border-block-end-style: solid; } :host([bordered][position=bottom]) .container { border-block-start-style: solid; } :host([bordered][selected]) .container { border-block-end-style: none; } :host([bordered][position=bottom][selected]) .container { border-block-start-style: none; } }