@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
312 lines (264 loc) • 5.84 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.
*/
:host {
/* Base ":host" styles for the component */
box-sizing: border-box;
background-color: var(--calcite-ui-foreground-1);
color: var(--calcite-ui-text-2);
font-size: var(--calcite-font-size--1);
}
:host * {
box-sizing: border-box;
}
:host {
/* Component spacing variables */
--calcite-icon-size: 1rem;
--calcite-spacing-eighth: ;
--calcite-spacing-quarter: 0.25rem;
--calcite-spacing-half: 0.5rem;
--calcite-spacing-three-quarters: 0.75rem;
--calcite-spacing: 1rem;
--calcite-spacing-plus-quarter: 1.25rem;
--calcite-spacing-plus-half: 1.5rem;
--calcite-spacing-double: 2rem;
--calcite-menu-min-width: 10rem;
--calcite-header-min-height: 3rem;
--calcite-footer-min-height: 3rem;
}
:root {
--calcite-popper-transition: 150ms ease-in-out;
}
:host([hidden]) {
display: none;
}
:host {
display: flex;
position: relative;
max-height: var(--calcite-panel-max-height);
width: var(--calcite-panel-width);
max-width: var(--calcite-panel-max-width);
min-width: var(--calcite-panel-min-width);
transition: max-height 150ms ease-in-out, width 150ms ease-in-out;
--calcite-min-header-height: calc(var(--calcite-icon-size) * 3);
--calcite-panel-max-height: unset;
--calcite-panel-width: 100%;
--calcite-panel-min-width: unset;
--calcite-panel-max-width: unset;
}
/* Shared styles for header elements */
.header {
margin: 0;
display: flex;
align-items: center;
justify-content: space-between;
color: var(--calcite-ui-text-2);
fill: var(--calcite-ui-text-2);
}
.heading {
padding: 0;
margin: 0;
font-weight: var(--calcite-font-weight-medium);
line-height: 1.5;
}
.header .heading {
flex: 1 0 auto;
padding: var(--calcite-spacing-half) var(--calcite-spacing-half);
}
h1.heading {
font-size: var(--calcite-font-size-2);
}
h2.heading {
font-size: var(--calcite-font-size-1);
}
h3.heading {
font-size: var(--calcite-font-size-0);
}
h4.heading,
h5.heading {
font-size: var(--calcite-font-size--1);
}
.container {
align-items: stretch;
background-color: var(--calcite-ui-background);
height: 100%;
width: 100%;
padding: 0;
margin: 0;
display: flex;
flex-flow: column;
}
calcite-scrim {
align-items: stretch;
width: 100%;
height: 100%;
display: flex;
flex-flow: column;
pointer-events: none;
}
:host([height-scale=s]) {
--calcite-panel-max-height: 40vh;
}
:host([height-scale=m]) {
--calcite-panel-max-height: 60vh;
}
:host([height-scale=l]) {
--calcite-panel-max-height: 80vh;
}
:host([width-scale=s]) {
--calcite-panel-width: 12vw;
--calcite-panel-max-width: 300px;
--calcite-panel-min-width: 150px;
}
:host([width-scale=m]) {
--calcite-panel-width: 20vw;
--calcite-panel-max-width: 420px;
--calcite-panel-min-width: 240px;
}
:host([width-scale=l]) {
--calcite-panel-width: 45vw;
--calcite-panel-max-width: 680px;
--calcite-panel-min-width: 340px;
}
.container[hidden] {
display: none;
}
:host([loading]) .container,
:host([disabled]) .container {
position: relative;
z-index: 1;
}
.header {
align-items: stretch;
background-color: var(--calcite-ui-foreground-1);
flex: 0 0 auto;
justify-content: flex-start;
min-height: var(--calcite-header-min-height);
position: sticky;
top: 0;
z-index: 2;
border-bottom: 1px solid var(--calcite-ui-border-3);
width: 100%;
}
.header-content {
display: block;
overflow: hidden;
margin-right: auto;
padding: var(--calcite-spacing) var(--calcite-spacing-three-quarters);
}
.header-content .heading,
.header-content .summary {
padding: 0;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
.header-content .heading {
font-weight: var(--calcite-font-weight-medium);
margin: 0 0 var(--calcite-spacing-quarter);
font-size: var(--calcite-font-size-0);
}
.header-content .heading:only-child {
margin-bottom: 0;
}
.header-content .summary {
color: var(--calcite-ui-text-3);
font-size: var(--calcite-font-size--2);
}
.header-actions {
align-items: stretch;
display: flex;
flex-flow: row nowrap;
}
.menu-container:only-child {
margin-left: auto;
}
.menu-button {
align-self: stretch;
flex: 0 1 auto;
height: 100%;
position: relative;
}
.menu {
min-width: var(--calcite-menu-min-width);
flex-flow: column nowrap;
}
.content-container {
align-items: stretch;
background-color: var(--calcite-ui-background);
display: flex;
flex-flow: column nowrap;
flex: 1 1 auto;
overflow: auto;
}
.footer {
background-color: var(--calcite-ui-foreground-1);
border-top: 1px solid var(--calcite-ui-border-3);
display: flex;
flex: 0 0 auto;
justify-content: space-evenly;
min-height: var(--calcite-footer-min-height);
padding: var(--calcite-spacing-half) var(--calcite-spacing-half);
position: sticky;
bottom: 0;
width: 100%;
}
.calcite--rtl .header-content {
margin-left: auto;
margin-right: unset;
}
.calcite--rtl .menu-container:only-child {
margin-left: unset;
margin-right: auto;
}
.fab-container {
position: sticky;
z-index: 1;
bottom: 0;
display: inline-block;
margin: 0 auto;
padding: var(--calcite-spacing-half) var(--calcite-spacing-half);
left: 0;
right: 0;
}