-
Notifications
You must be signed in to change notification settings - Fork 6
/
vwc-side-drawer.scss
111 lines (98 loc) 路 2.71 KB
/
vwc-side-drawer.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
@use 'partials/vwc-side-drawer-variables' as variables;
@use '@vonage/vvd-design-tokens/build/scss/semantic-variables/scheme-variables' as scheme-variables;
@use '@vonage/vvd-typography/scss/typography' as typography;
@use '@vonage/vvd-foundation/scss/mixins/scrim' as scrim-mixins;
$z-index-default: 6;
$padding-default: 16px;
$inline-size: var(#{variables.$side-drawer-inline-size}, 280px);
:host {
display: flex;
block-size: 100vh;
}
:host([position='end']) {
flex-direction: row-reverse;
}
.side-drawer {
position: fixed;
z-index: var(#{variables.$side-drawer-z-index}, #{$z-index-default});
display: flex;
overflow: auto;
flex-direction: column;
flex-shrink: 0;
background-color: var(#{variables.$side-drawer-background-color}, var(#{scheme-variables.$vvd-color-canvas}));
block-size: inherit;
color: var(#{variables.$side-drawer-color}, var(#{scheme-variables.$vvd-color-on-canvas}));
inline-size: #{$inline-size};
&.side-drawer-alternate {
background-color: var(#{scheme-variables.$vvd-color-canvas});
}
&.side-drawer-modal,
&.side-drawer-dismissible {
transform: translateX(0%);
&:not(.side-drawer-open) {
&.side-drawer-end {
transform: translateX(100%);
}
&:not(.side-drawer-end) {
transform: translateX(-100%);
}
}
@media (prefers-reduced-motion: no-preference) {
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
}
&.side-drawer-dismissible.side-drawer-open,
&:not(.side-drawer-dismissible):not(.side-drawer-modal) {
+ .side-drawer-app-content {
@include typography.typography-cat-shorthand(body-1);
margin-inline-start: #{$inline-size};
::slotted(vwc-top-app-bar),
::slotted(vwc-top-app-bar-fixed) {
--mdc-top-app-bar-width: calc(100% - #{$inline-size});
}
}
&.side-drawer-end {
+ .side-drawer-app-content {
margin-inline-end: var(--side-drawer-inline-size, 280px);
margin-inline-start: 0;
}
}
}
}
.side-drawer-top-bar {
$gutter: var(#{variables.$side-drawer-padding-top-bar}, #{$padding-default});
@include typography.typography-cat-shorthand(subtitle-1);
display: flex;
flex-shrink: 0;
align-items: center;
block-size: 64px;
padding-inline-end: #{$gutter};
padding-inline-start: #{$gutter};
}
.side-drawer-content {
$gutter: var(#{variables.$side-drawer-padding-body}, #{$padding-default});
background-color: inherit;
overflow-y: auto;
padding-inline-end: #{$gutter};
padding-inline-start: #{$gutter};
}
.side-drawer-modal {
position: fixed;
top: 0;
bottom: 0;
&:not(.side-drawer-end) {
inset-inline-start: 0;
}
&.side-drawer-end {
inset-inline-end: 0;
}
}
.side-drawer-scrim {
@include scrim-mixins.scrim-variables;
position: fixed;
z-index: calc(#{$z-index-default} - 1);
top: 0;
right: 0;
bottom: 0;
left: 0;
}