UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

325 lines (272 loc) • 7.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-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-context([theme=dark]) { --calcite-ui-blue-1: #00A0FF; --calcite-ui-blue-2: #0087D7; --calcite-ui-blue-3: #47BBFF; --calcite-ui-green-1: #36DA43; --calcite-ui-green-2: #11AD1D; --calcite-ui-green-3: #44ED51; --calcite-ui-yellow-1: #FFC900; --calcite-ui-yellow-2: #F4B000; --calcite-ui-yellow-3: #FFE24D; --calcite-ui-red-1: #FE583E; --calcite-ui-red-2: #F3381B; --calcite-ui-red-3: #FF7465; --calcite-ui-background: #202020; --calcite-ui-foreground-1: #2b2b2b; --calcite-ui-foreground-2: #353535; --calcite-ui-foreground-3: #404040; --calcite-ui-text-1: #ffffff; --calcite-ui-text-2: #bfbfbf; --calcite-ui-text-3: #9f9f9f; --calcite-ui-border-1: #4a4a4a; --calcite-ui-border-2: #404040; --calcite-ui-border-3: #353535; --calcite-ui-border-4: #757575; --calcite-ui-border-5: #9f9f9f; } :host([scale=s]) { --calcite-notice-spacing-token-small: 0.75rem; --calcite-notice-spacing-token-large: 1rem; } :host([scale=s]) slot[name=notice-title]::slotted(*), :host([scale=s]) *::slotted([slot=notice-title]) { font-size: 0.875rem; line-height: 1.5; } :host([scale=s]) slot[name=notice-message]::slotted(*), :host([scale=s]) *::slotted([slot=notice-message]) { font-size: 0.8125rem; line-height: 1.5; } :host([scale=s]) ::slotted(calcite-link) { font-size: 0.8125rem; line-height: 1.5; } :host([scale=m]) { --calcite-notice-spacing-token-small: 1rem; --calcite-notice-spacing-token-large: 1.5rem; } :host([scale=m]) slot[name=notice-title]::slotted(*), :host([scale=m]) *::slotted([slot=notice-title]) { font-size: 0.9375rem; line-height: 1.5; } :host([scale=m]) slot[name=notice-message]::slotted(*), :host([scale=m]) *::slotted([slot=notice-message]) { font-size: 0.875rem; line-height: 1.5; } :host([scale=m]) ::slotted(calcite-link) { font-size: 0.875rem; line-height: 1.5; } :host([scale=l]) { --calcite-notice-spacing-token-small: 1.2rem; --calcite-notice-spacing-token-large: 1.875rem; } :host([scale=l]) slot[name=notice-title]::slotted(*), :host([scale=l]) *::slotted([slot=notice-title]) { font-size: 1rem; line-height: 1.5; } :host([scale=l]) slot[name=notice-message]::slotted(*), :host([scale=l]) *::slotted([slot=notice-message]) { font-size: 0.9375rem; line-height: 1.5; } :host([scale=l]) ::slotted(calcite-link) { font-size: 0.9375rem; line-height: 1.5; } :host([width=auto]) { --calcite-notice-width: auto; } :host([width=half]) { --calcite-notice-width: 50%; } :host([width=full]) { --calcite-notice-width: 100%; } :host { display: none; text-align: left; margin: 0 auto; box-sizing: border-box; width: var(--calcite-notice-width); max-width: 100%; max-height: 0; background-color: var(--calcite-ui-foreground-1); opacity: 0; pointer-events: none; transition: 150ms ease-in-out; border-left: 0px solid; box-shadow: 0 0 0 0 transparent; } .notice-close { outline-offset: 0; outline-color: transparent; transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out; } .notice-close:focus { outline: 2px solid var(--calcite-ui-blue-1); outline-offset: -2px; } :host([dir=rtl]) { text-align: right; border-left: none; border-right: 0px solid; } :host([active]) { box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04); display: flex; align-items: center; opacity: 1; max-height: 100%; pointer-events: initial; border-width: 3px; } slot[name=notice-title]::slotted(*), *::slotted([slot=notice-title]) { color: var(--calcite-ui-text-1); margin: 0; font-weight: 500; } slot[name=notice-message]::slotted(*), *::slotted([slot=notice-message]) { display: inline; margin: 0; font-weight: 400; margin-right: var(--calcite-notice-spacing-token-small); color: var(--calcite-ui-text-2); } :host([dir=rtl]) slot[name=notice-message]::slotted(*), :host([dir=rtl]) *::slotted([slot=notice-message]) { margin-right: 0; margin-left: var(--calcite-notice-spacing-token-small); } .notice-content { box-sizing: border-box; padding: var(--calcite-notice-spacing-token-small) var(--calcite-notice-spacing-token-large); flex: 0 0 auto; transition: all 0.15s ease-in-out; display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; word-wrap: break-word; padding: var(--calcite-notice-spacing-token-small) var(--calcite-notice-spacing-token-small) var(--calcite-notice-spacing-token-small) 0; } .notice-content:first-of-type:not(:only-child) { padding-left: var(--calcite-notice-spacing-token-large); } .notice-content:only-of-type { padding: var(--calcite-notice-spacing-token-small) var(--calcite-notice-spacing-token-large); } :host([dir=rtl]) .notice-content { padding: var(--calcite-notice-spacing-token-small) 0 var(--calcite-notice-spacing-token-small) var(--calcite-notice-spacing-token-small); } :host([dir=rtl]) .notice-content:first-of-type:not(:only-child) { padding-right: var(--calcite-notice-spacing-token-large); } :host([dir=rtl]) .notice-content:only-of-type { padding: var(--calcite-notice-spacing-token-small) var(--calcite-notice-spacing-token-large); } .notice-icon { box-sizing: border-box; padding: var(--calcite-notice-spacing-token-small) var(--calcite-notice-spacing-token-large); flex: 0 0 auto; transition: all 0.15s ease-in-out; display: flex; align-items: center; } .notice-close { box-sizing: border-box; padding: var(--calcite-notice-spacing-token-small) var(--calcite-notice-spacing-token-large); flex: 0 0 auto; transition: all 0.15s ease-in-out; align-self: stretch; background-color: transparent; -webkit-appearance: none; border: none; outline: none; cursor: pointer; color: var(--calcite-ui-text-3); } .notice-close:hover, .notice-close:focus { background-color: var(--calcite-ui-foreground-2); } .notice-close:active { background-color: var(--calcite-ui-foreground-3); } :host([color=blue]) { border-color: var(--calcite-ui-blue-1); } :host([color=blue]) .notice-icon { color: var(--calcite-ui-blue-1); } :host([color=red]) { border-color: var(--calcite-ui-red-1); } :host([color=red]) .notice-icon { color: var(--calcite-ui-red-1); } :host([color=yellow]) { border-color: var(--calcite-ui-yellow-1); } :host([color=yellow]) .notice-icon { color: var(--calcite-ui-yellow-1); } :host([color=green]) { border-color: var(--calcite-ui-green-1); } :host([color=green]) .notice-icon { color: var(--calcite-ui-green-1); }