@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
345 lines (307 loc) • 7.36 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);
}
}
: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-scale {
animation-name: in-scale;
}
/**
* 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;
}
:root {
--calcite-popper-transition: var(--calcite-animation-timing);
}
:host([hidden]) {
display: none;
}
/**
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-panel-max-height: the maximum height of the panel
* @prop --calcite-panel-max-width: the maximum width of the panel
* @prop --calcite-panel-min-width: the minimum width of the panel
*/
:host {
position: relative;
display: flex;
width: 100%;
flex: 1 1 auto;
overflow: hidden;
--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;
}
:host([disabled]) {
pointer-events: none;
cursor: default;
-webkit-user-select: none;
user-select: none;
opacity: var(--calcite-ui-opacity-disabled);
}
:host([disabled]) ::slotted([calcite-hydrated][disabled]),
:host([disabled]) [calcite-hydrated][disabled] {
/* prevent opacity stacking */
opacity: 1;
}
/* Shared styles for header elements */
.header {
margin: 0px;
display: flex;
align-content: space-between;
align-items: center;
fill: var(--calcite-ui-text-2);
color: var(--calcite-ui-text-2);
}
.heading {
margin: 0px;
padding: 0px;
font-weight: var(--calcite-font-weight-medium);
}
.header .heading {
flex: 1 1 auto;
padding: 0.5rem;
}
h1.heading {
font-size: var(--calcite-font-size-2);
line-height: 1.5rem;
}
h2.heading {
font-size: var(--calcite-font-size-1);
line-height: 1.5rem;
}
h3.heading {
font-size: var(--calcite-font-size-0);
line-height: 1.25rem;
}
h4.heading, h5.heading {
font-size: var(--calcite-font-size--1);
line-height: 1rem;
}
.container {
margin: 0px;
display: flex;
width: 100%;
flex: 1 1 auto;
flex-direction: column;
align-items: stretch;
background-color: var(--calcite-ui-background);
padding: 0px;
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 var(--calcite-animation-timing), width var(--calcite-animation-timing);
}
: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: calc(var(--calcite-panel-width-multiplier) * 12vw);
--calcite-panel-max-width: calc(var(--calcite-panel-width-multiplier) * 300px);
--calcite-panel-min-width: calc(var(--calcite-panel-width-multiplier) * 150px);
}
:host([width-scale=m]) {
--calcite-panel-width: calc(var(--calcite-panel-width-multiplier) * 20vw);
--calcite-panel-max-width: calc(var(--calcite-panel-width-multiplier) * 420px);
--calcite-panel-min-width: calc(var(--calcite-panel-width-multiplier) * 240px);
}
:host([width-scale=l]) {
--calcite-panel-width: calc(var(--calcite-panel-width-multiplier) * 45vw);
--calcite-panel-max-width: calc(var(--calcite-panel-width-multiplier) * 680px);
--calcite-panel-min-width: calc(var(--calcite-panel-width-multiplier) * 340px);
}
.container[hidden] {
display: none;
}
:host([loading]) .container, :host([disabled]) .container {
position: relative;
z-index: 1;
}
.header {
border-bottom: 1px solid;
position: sticky;
top: 0px;
width: 100%;
align-items: stretch;
justify-content: flex-start;
background-color: var(--calcite-ui-foreground-1);
border-bottom-color: var(--calcite-ui-border-3);
flex: 0 0 auto;
z-index: 2;
}
.header-content {
display: flex;
flex-direction: column;
padding-left: 0.75rem;
padding-right: 0.75rem;
padding-top: 0.875rem;
padding-bottom: 0.875rem;
overflow: hidden;
margin-inline-end: auto;
}
.header-content .heading, .header-content .summary {
display: block;
overflow-wrap: break-word;
padding: 0px;
}
.header-content .heading {
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
margin-bottom: 0.25rem;
font-size: var(--calcite-font-size-0);
line-height: 1.25rem;
font-weight: var(--calcite-font-weight-medium);
}
.header-content .heading:only-child {
margin-bottom: 0px;
}
.header-content .summary {
font-size: var(--calcite-font-size--1);
line-height: 1rem;
color: var(--calcite-ui-text-2);
}
.back-button {
border-width: 0px;
border-style: solid;
border-color: var(--calcite-ui-border-3);
border-inline-end-width: 1px;
}
.header-actions {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: stretch;
}
.header-actions--end,
.menu-container:only-child {
margin-inline-start: auto;
}
.menu-button {
position: relative;
height: 100%;
flex: 0 1 auto;
align-self: stretch;
}
.menu {
min-width: 10rem;
flex-flow: column nowrap;
}
.content-wrapper {
overflow: auto;
}
.content-height {
height: 100%;
}
.content-container {
display: flex;
flex: 1 1 auto;
flex-direction: column;
flex-wrap: nowrap;
align-items: stretch;
background-color: var(--calcite-ui-background);
}
.footer {
border-top: 1px solid;
position: sticky;
bottom: 0px;
display: flex;
width: 100%;
justify-content: space-evenly;
background-color: var(--calcite-ui-foreground-1);
border-top-color: var(--calcite-ui-border-3);
flex: 0 0 auto;
min-height: 3rem;
padding: 0.5rem;
}
.fab-container {
position: sticky;
bottom: 0px;
left: 0px;
right: 0px;
margin-top: 0px;
margin-bottom: 0px;
margin-left: auto;
margin-right: auto;
display: block;
padding: 0.5rem;
width: -moz-fit-content;
width: fit-content;
z-index: 1;
}