@adobe/coral-spectrum
Version:
Coral Spectrum is a JavaScript library of Web Components following Spectrum design patterns.
589 lines (534 loc) • 14.2 kB
CSS
/**
* Copyright 2019 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
._coral-Dialog {
visibility: hidden;
opacity: 0;
transition: transform 130ms ease-in-out,
opacity 130ms ease-in-out,
visibility 0ms linear 130ms;
pointer-events: none;
}
._coral-Dialog.is-open {
visibility: visible;
opacity: 1;
transition-delay: 0ms;
pointer-events: auto;
}
._coral-Dialog {
display: -ms-flexbox;
display: flex;
-ms-flex-direction: column;
flex-direction: column;
position: fixed;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%) translateY(20px);
z-index: 2;
box-sizing: border-box;
max-width: 90vw;
max-height: 90vh;
width: -webkit-fit-content;
width: fit-content;
min-width: 288px;
padding: 40px;
border-radius: 4px;
outline: none;
transition: opacity 130ms cubic-bezier(.50, 0, 1, 1) 0ms,
visibility 0ms linear 130ms,
transform 0ms linear 130ms;
}
._coral-Dialog.is-open {
transition: transform 250ms cubic-bezier(0, 0, 0.40, 1) 160ms,
opacity 250ms cubic-bezier(0, 0, 0.40, 1) 160ms;
transform: translate(-50%, calc(-50% + -2vh));
}
._coral-Dialog ._coral-Dialog-closeButton {
display: none;
}
._coral-Dialog--small {
width: 400px;
}
._coral-Dialog--medium {
width: 480px;
}
._coral-Dialog--large {
width: 640px;
}
._coral-Dialog-hero {
height: 128px;
margin-left: -40px;
margin-right: -40px;
margin-top: -40px;
margin-bottom: 40px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
background-size: cover;
background-position: center center;
}
._coral-Dialog-header {
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
position: relative;
box-sizing: border-box;
width: 100%;
-ms-flex-negative: 0;
flex-shrink: 0;
border-radius: 4px 4px 0 0;
outline: none;
padding-bottom: 30px;
}
._coral-Dialog-header::after {
position: absolute;
bottom: 16px;
left: 0;
right: 0;
content: '';
height: 2px;
}
._coral-Dialog-wrapper {
position: fixed;
left: 0;
top: 0;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
height: 100%;
visibility: hidden;
pointer-events: none;
z-index: 2;
transition: visibility 0ms linear 130ms;
}
._coral-Dialog-wrapper.is-open {
visibility: visible;
}
._coral-Dialog-wrapper ._coral-Dialog:not(._coral-Dialog--fullscreen):not(._coral-Dialog--fullscreenTakeover) {
pointer-events: auto;
position: relative;
left: auto;
top: auto;
transform: translateY(20px);
margin-top: -2vh;
}
._coral-Dialog-wrapper ._coral-Dialog:not(._coral-Dialog--fullscreen):not(._coral-Dialog--fullscreenTakeover).is-open {
transform: translateY(0);
}
@media
only screen and (max-device-width: 400px), only screen and (max-device-height: 350px) {
._coral-Dialog--responsive {
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
border-radius: 0;
}
._coral-Dialog-wrapper ._coral-Dialog--responsive {
margin-top: 0;
}
}
._coral-Dialog--noDivider ._coral-Dialog-header::after {
display: none;
}
._coral-Dialog--dismissible ._coral-Dialog-footer {
display: none;
}
._coral-Dialog--dismissible ._coral-Dialog-closeButton {
display: initial;
}
._coral-Dialog-closeButton {
position: absolute;
top: -28px;
right: -28px;
}
._coral-Dialog-typeIcon {
display: block;
margin-left: 24px;
-ms-flex-negative: 0;
flex-shrink: 0;
-ms-flex-item-align: start;
align-self: flex-start;
}
._coral-Dialog-content {
display: block;
box-sizing: border-box;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
outline: none;
font-size: 14px;
font-weight: 400;
line-height: 1.5;
}
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
._coral-Dialog-content {
max-height: 70vh;
}
}
._coral-Dialog-footer {
border-radius: 0 0 4px 4px;
padding-top: 28px;
-ms-flex: 0 1 auto;
flex: 0 1 auto;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
display: -ms-flexbox;
display: flex;
-ms-flex-pack: end;
justify-content: flex-end;
outline: none;
margin: -8px;
margin-top: 0;
}
._coral-Dialog-footer > *,
._coral-Dialog-footer > ._coral-Button + ._coral-Button {
margin: 8px;
}
._coral-Dialog-title {
-ms-flex: 1 1 auto;
flex: 1 1 auto;
margin: 0;
font-size: 18px;
font-weight: 700;
line-height: 1.3;
outline: none;
}
._coral-Dialog--alert {
width: 480px;
}
._coral-Dialog--fullscreen {
left: 32px;
top: 32px;
right: 32px;
bottom: 32px;
transform: translate(0, 20px);
}
._coral-Dialog--fullscreen.is-open {
transform: translate(0, 0);
}
._coral-Dialog--fullscreen,
._coral-Dialog--fullscreenTakeover {
width: auto;
max-height: none;
max-width: none;
padding-top: 30px;
}
._coral-Dialog--fullscreen ._coral-Dialog-header, ._coral-Dialog--fullscreenTakeover ._coral-Dialog-header {
-ms-flex-negative: 0;
flex-shrink: 0;
}
._coral-Dialog--fullscreen ._coral-Dialog-title, ._coral-Dialog--fullscreenTakeover ._coral-Dialog-title {
font-size: 28px;
font-weight: 100;
}
._coral-Dialog--fullscreen ._coral-Dialog-content, ._coral-Dialog--fullscreenTakeover ._coral-Dialog-content {
max-height: none;
}
._coral-Dialog--fullscreenTakeover {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
box-sizing: border-box;
border: none;
border-radius: 0;
}
._coral-Dialog--fullscreenTakeover,
._coral-Dialog--fullscreenTakeover.is-open {
transform: none;
}
.coral--large ._coral-Dialog {
transition: transform 130ms ease-in-out,
opacity 130ms ease-in-out,
visibility 0ms linear 130ms;
transform: translateX(-50%) translateY(-50%) translateY(25px);
max-width: 90vw;
max-height: 90vh;
min-width: 288px;
padding: 24px;
border-radius: 5px;
transition: opacity 130ms cubic-bezier(.50, 0, 1, 1) 0ms,
visibility 0ms linear 130ms,
transform 0ms linear 130ms;
}
.coral--large ._coral-Dialog.is-open {
transition: transform 250ms cubic-bezier(0, 0, 0.40, 1) 160ms,
opacity 250ms cubic-bezier(0, 0, 0.40, 1) 160ms;
transform: translate(-50%, calc(-50% + -2vh));
}
.coral--large ._coral-Dialog--small {
width: 400px;
}
.coral--large ._coral-Dialog--medium {
width: 480px;
}
.coral--large ._coral-Dialog--large {
width: 640px;
}
.coral--large ._coral-Dialog-hero {
height: 160px;
margin-left: -24px;
margin-right: -24px;
margin-top: -24px;
margin-bottom: 24px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.coral--large ._coral-Dialog-header {
border-radius: 5px 5px 0 0;
padding-bottom: 30px;
}
.coral--large ._coral-Dialog-header::after {
bottom: 16px;
height: 2px;
}
.coral--large ._coral-Dialog-wrapper {
transition: visibility 0ms linear 130ms;
}
.coral--large ._coral-Dialog-wrapper ._coral-Dialog:not(._coral-Dialog--fullscreen):not(._coral-Dialog--fullscreenTakeover) {
transform: translateY(25px);
margin-top: -2vh;
}
.coral--large ._coral-Dialog-closeButton {
top: -35px;
right: -35px;
}
.coral--large ._coral-Dialog-typeIcon {
margin-left: 24px;
}
.coral--large ._coral-Dialog-content {
font-size: 15px;
font-weight: 400;
line-height: 1.5;
}
.coral--large ._coral-Dialog-footer {
border-radius: 0 0 5px 5px;
padding-top: 35px;
margin: -10px;
}
.coral--large ._coral-Dialog-footer > *,
.coral--large ._coral-Dialog-footer > ._coral-Button + ._coral-Button {
margin: 10px;
}
.coral--large ._coral-Dialog-title {
font-size: 19px;
font-weight: 700;
line-height: 1.3;
}
.coral--large ._coral-Dialog--alert {
width: 480px;
}
.coral--large ._coral-Dialog--fullscreen {
left: 32px;
top: 32px;
right: 32px;
bottom: 32px;
transform: translate(0, 25px);
}
.coral--large ._coral-Dialog--fullscreen,
.coral--large ._coral-Dialog--fullscreenTakeover {
padding-top: 14px;
}
.coral--large ._coral-Dialog--fullscreen ._coral-Dialog-title, .coral--large ._coral-Dialog--fullscreenTakeover ._coral-Dialog-title {
font-size: 28px;
font-weight: 100;
}
.coral--light ._coral-Dialog,.coral--light ._coral-Dialog-header {
background: rgb(245, 245, 245);
}
.coral--light ._coral-Dialog-header:after {
background: rgb(225, 225, 225);
}
.coral--light ._coral-Dialog-title {
color: rgb(44, 44, 44);
}
.coral--light ._coral-Dialog-content {
color: rgb(75, 75, 75);
}
.coral--light ._coral-Dialog-typeIcon {
color: rgb(44, 44, 44);
}
.coral--light ._coral-Dialog-footer {
background: rgb(245, 245, 245);
}
.coral--light ._coral-Dialog--error ._coral-Dialog-title,.coral--light ._coral-Dialog--error ._coral-Dialog-typeIcon {
color: rgb(201, 37, 45);
}
.coral--lightest ._coral-Dialog,.coral--lightest ._coral-Dialog-header {
background: rgb(255, 255, 255);
}
.coral--lightest ._coral-Dialog-header:after {
background: rgb(234, 234, 234);
}
.coral--lightest ._coral-Dialog-title {
color: rgb(50, 50, 50);
}
.coral--lightest ._coral-Dialog-content {
color: rgb(80, 80, 80);
}
.coral--lightest ._coral-Dialog-typeIcon {
color: rgb(50, 50, 50);
}
.coral--lightest ._coral-Dialog-footer {
background: rgb(255, 255, 255);
}
.coral--lightest ._coral-Dialog--error ._coral-Dialog-title,.coral--lightest ._coral-Dialog--error ._coral-Dialog-typeIcon {
color: rgb(215, 55, 63);
}
.coral--dark ._coral-Dialog,.coral--dark ._coral-Dialog-header {
background: rgb(50, 50, 50);
}
.coral--dark ._coral-Dialog-header:after {
background: rgb(74, 74, 74);
}
.coral--dark ._coral-Dialog-title {
color: rgb(255, 255, 255);
}
.coral--dark ._coral-Dialog-content {
color: rgb(227, 227, 227);
}
.coral--dark ._coral-Dialog-typeIcon {
color: rgb(255, 255, 255);
}
.coral--dark ._coral-Dialog-footer {
background: rgb(50, 50, 50);
}
.coral--dark ._coral-Dialog--error ._coral-Dialog-title,.coral--dark ._coral-Dialog--error ._coral-Dialog-typeIcon {
color: rgb(247, 109, 116);
}
.coral--darkest ._coral-Dialog,.coral--darkest ._coral-Dialog-header {
background: rgb(30, 30, 30);
}
.coral--darkest ._coral-Dialog-header:after {
background: rgb(57, 57, 57);
}
.coral--darkest ._coral-Dialog-title {
color: rgb(239, 239, 239);
}
.coral--darkest ._coral-Dialog-content {
color: rgb(200, 200, 200);
}
.coral--darkest ._coral-Dialog-typeIcon {
color: rgb(239, 239, 239);
}
.coral--darkest ._coral-Dialog-footer {
background: rgb(30, 30, 30);
}
.coral--darkest ._coral-Dialog--error ._coral-Dialog-title,.coral--darkest ._coral-Dialog--error ._coral-Dialog-typeIcon {
color: rgb(236, 91, 98);
}
coral-dialog {
display: none;
}
._coral-Dialog--noBackdrop {
border: 1px solid;
}
._coral-Dialog-closeButton {
top: 8px;
right: 8px;
}
coral-dialog-footer {
display: block;
}
coral-dialog-footer:empty {
display: none;
}
._coral-Dialog-wrapper {
outline: none;
}
._coral-Dialog-wrapper:not(.is-open) ._coral-Dialog:not(._coral-Dialog--fullscreen):not(._coral-Dialog--fullscreenTakeover) {
pointer-events: none;
}
coral-dialog-header {
z-index: 1;
}
._coral-Dialog-dragZone {
position: absolute;
width: calc(100% + calc(40px * 2));
height: calc(100% + calc(40px - 16px));
left: -40px;
top: -40px;
}
._coral-Dialog--dismissible ._coral-Dialog-closeButton {
display: inline-flex;
}
.coral--light ._coral-Dialog--noBackdrop {
box-shadow: 0 1px 4px rgba(0,0,0,0.15);
border-color: rgb(202, 202, 202);
}
.coral--light ._coral-Dialog--warning ._coral-Dialog-typeIcon {
color: rgb(203, 111, 16);
}
.coral--light ._coral-Dialog--success ._coral-Dialog-typeIcon {
color: rgb(18, 128, 92);
}
.coral--light ._coral-Dialog--info ._coral-Dialog-typeIcon {
color: rgb(13, 102, 208);
}
.coral--light ._coral-Dialog--help ._coral-Dialog-typeIcon {
color: rgb(13, 102, 208);
}
.coral--lightest ._coral-Dialog--noBackdrop {
box-shadow: 0 1px 4px rgba(0,0,0,0.15);
border-color: rgb(211, 211, 211);
}
.coral--lightest ._coral-Dialog--warning ._coral-Dialog-typeIcon {
color: rgb(242, 148, 35);
}
.coral--lightest ._coral-Dialog--success ._coral-Dialog-typeIcon {
color: rgb(51, 171, 132);
}
.coral--lightest ._coral-Dialog--info ._coral-Dialog-typeIcon {
color: rgb(55, 142, 240);
}
.coral--lightest ._coral-Dialog--help ._coral-Dialog-typeIcon {
color: rgb(55, 142, 240);
}
.coral--dark ._coral-Dialog--noBackdrop {
box-shadow: 0 1px 4px rgba(0,0,0,0.5);
border-color: rgb(90, 90, 90);
}
.coral--dark ._coral-Dialog--warning ._coral-Dialog-typeIcon {
color: rgb(230, 134, 25);
}
.coral--dark ._coral-Dialog--success ._coral-Dialog-typeIcon {
color: rgb(45, 157, 120);
}
.coral--dark ._coral-Dialog--info ._coral-Dialog-typeIcon {
color: rgb(38, 128, 235);
}
.coral--dark ._coral-Dialog--help ._coral-Dialog-typeIcon {
color: rgb(38, 128, 235);
}
.coral--darkest ._coral-Dialog--noBackdrop {
box-shadow: 0 1px 4px rgba(0,0,0,0.8);
border-color: rgb(73, 73, 73);
}
.coral--darkest ._coral-Dialog--warning ._coral-Dialog-typeIcon {
color: rgb(218, 123, 17);
}
.coral--darkest ._coral-Dialog--success ._coral-Dialog-typeIcon {
color: rgb(38, 142, 108);
}
.coral--darkest ._coral-Dialog--info ._coral-Dialog-typeIcon {
color: rgb(20, 115, 230);
}
.coral--darkest ._coral-Dialog--help ._coral-Dialog-typeIcon {
color: rgb(20, 115, 230);
}