2023-01-04 00:58:38 +08:00
|
|
|
/*
|
2023-09-18 02:35:35 +08:00
|
|
|
Copyright 2022 - 2023 New Vector Ltd
|
2023-01-04 00:58:38 +08:00
|
|
|
|
|
|
|
Licensed 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 CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2021-12-04 03:45:29 +08:00
|
|
|
.modal {
|
2021-12-15 07:28:54 +08:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-12-04 03:45:29 +08:00
|
|
|
}
|
|
|
|
|
2023-09-18 02:35:35 +08:00
|
|
|
.dialog {
|
|
|
|
box-sizing: border-box;
|
|
|
|
inline-size: 520px;
|
|
|
|
max-inline-size: 90%;
|
|
|
|
max-block-size: 600px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.content {
|
2021-12-04 03:45:29 +08:00
|
|
|
display: flex;
|
2023-09-18 02:35:35 +08:00
|
|
|
flex-direction: column;
|
|
|
|
overflow: hidden;
|
2023-09-19 22:21:11 +08:00
|
|
|
flex-grow: 1;
|
2023-09-18 02:35:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.dialog .content {
|
|
|
|
background: var(--cpd-color-bg-canvas-default);
|
|
|
|
}
|
|
|
|
|
|
|
|
.drawer .content {
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.drawer {
|
|
|
|
background: var(--cpd-color-bg-canvas-default);
|
|
|
|
inset-block-end: 0;
|
|
|
|
inset-inline: max(0px, calc((100% - 520px) / 2));
|
|
|
|
max-block-size: 90%;
|
2023-09-19 00:17:31 +08:00
|
|
|
border-start-start-radius: var(--border-radius);
|
|
|
|
border-start-end-radius: var(--border-radius);
|
|
|
|
/* Drawer comes in the Android style by default */
|
|
|
|
--border-radius: 28px;
|
2023-09-18 02:35:35 +08:00
|
|
|
--handle-block-size: 4px;
|
|
|
|
--handle-inline-size: 32px;
|
|
|
|
--handle-inset-block-start: var(--cpd-space-4x);
|
|
|
|
--handle-inset-block-end: var(--cpd-space-4x);
|
|
|
|
}
|
|
|
|
|
|
|
|
body[data-platform="ios"] .drawer {
|
2023-09-19 00:17:31 +08:00
|
|
|
--border-radius: 10px;
|
2023-09-18 02:35:35 +08:00
|
|
|
--handle-block-size: 5px;
|
|
|
|
--handle-inline-size: 36px;
|
|
|
|
--handle-inset-block-start: var(--cpd-space-1-5x);
|
|
|
|
--handle-inset-block-end: calc(var(--cpd-space-1x) / 4);
|
2021-12-04 03:45:29 +08:00
|
|
|
}
|
|
|
|
|
2023-09-18 02:35:35 +08:00
|
|
|
.close {
|
|
|
|
cursor: pointer;
|
|
|
|
color: var(--cpd-color-icon-secondary);
|
|
|
|
border-radius: var(--cpd-radius-pill-effect);
|
|
|
|
padding: var(--cpd-space-1x);
|
|
|
|
background: var(--cpd-color-bg-subtle-secondary);
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.close svg {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (hover: hover) {
|
|
|
|
.close:hover {
|
|
|
|
background: var(--cpd-color-bg-subtle-primary);
|
|
|
|
color: var(--cpd-color-icon-primary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.close:active {
|
|
|
|
background: var(--cpd-color-bg-subtle-primary);
|
|
|
|
color: var(--cpd-color-icon-primary);
|
|
|
|
}
|
|
|
|
|
|
|
|
.header {
|
|
|
|
background: var(--cpd-color-bg-subtle-secondary);
|
|
|
|
display: grid;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dialog .header {
|
|
|
|
padding-block-start: var(--cpd-space-4x);
|
|
|
|
grid-template-columns:
|
|
|
|
var(--cpd-space-10x) 1fr minmax(var(--cpd-space-6x), auto)
|
|
|
|
var(--cpd-space-4x);
|
|
|
|
grid-template-rows: auto minmax(var(--cpd-space-4x), auto);
|
|
|
|
/* TODO: Support tabs */
|
|
|
|
grid-template-areas: ". title close ." "tabs tabs tabs tabs";
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dialog .header h2 {
|
|
|
|
grid-area: title;
|
2021-12-04 03:45:29 +08:00
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
2023-09-18 02:35:35 +08:00
|
|
|
.drawer .header {
|
|
|
|
grid-template-areas: "tabs";
|
2021-12-04 03:45:29 +08:00
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2023-09-18 02:35:35 +08:00
|
|
|
.close {
|
|
|
|
grid-area: close;
|
2021-12-04 03:45:29 +08:00
|
|
|
}
|
|
|
|
|
2023-09-19 05:34:24 +08:00
|
|
|
.body {
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
|
2023-09-18 02:35:35 +08:00
|
|
|
.dialog .body {
|
|
|
|
padding-inline: var(--cpd-space-10x);
|
|
|
|
padding-block: var(--cpd-space-10x) var(--cpd-space-12x);
|
|
|
|
overflow: auto;
|
2021-12-04 03:45:29 +08:00
|
|
|
}
|
2021-12-11 02:54:18 +08:00
|
|
|
|
2023-09-18 02:35:35 +08:00
|
|
|
.drawer .body {
|
|
|
|
padding-inline: var(--cpd-space-4x);
|
|
|
|
padding-block: var(--cpd-space-9x) var(--cpd-space-10x);
|
|
|
|
}
|
2022-01-22 07:43:03 +08:00
|
|
|
|
2023-09-18 02:35:35 +08:00
|
|
|
.handle {
|
|
|
|
content: "";
|
|
|
|
position: absolute;
|
|
|
|
block-size: var(--handle-block-size);
|
|
|
|
inset-inline: calc((100% - var(--handle-inline-size)) / 2);
|
|
|
|
inset-block-start: var(--handle-inset-block-start);
|
|
|
|
background: var(--cpd-color-icon-secondary);
|
|
|
|
border-radius: var(--cpd-radius-pill-effect);
|
2021-12-11 02:54:18 +08:00
|
|
|
}
|