@jupyter/web-components
Version:
A component library for building extensions in Jupyter frontends.
56 lines (51 loc) • 1.22 kB
JavaScript
// Copyright (c) Jupyter Development Team.
// Copyright (c) Microsoft Corporation.
// Distributed under the terms of the Modified BSD License.
import { css } from '@microsoft/fast-element';
import { controlCornerRadius, fillColor, strokeWidth } from '../design-tokens.js';
import { elevation } from '../styles/elevation.js';
/**
* Styles for Dialog
* @public
*/
export const dialogStyles = (context, definition) => css `
:host([hidden]) {
display: none;
}
:host {
--elevation: 14;
--dialog-height: 480px;
--dialog-width: 640px;
display: block;
}
.overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
touch-action: none;
}
.positioning-region {
display: flex;
justify-content: center;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
.control {
${elevation}
margin-top: auto;
margin-bottom: auto;
width: var(--dialog-width);
height: var(--dialog-height);
background-color: ${fillColor};
z-index: 1;
border-radius: calc(${controlCornerRadius} * 1px);
border: calc(${strokeWidth} * 1px) solid transparent;
}
`;