-
Notifications
You must be signed in to change notification settings - Fork 155
/
styles.scss
201 lines (174 loc) · 4.8 KB
/
styles.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
@use '../../../internal/styles' as styles;
@use '../../../internal/styles/tokens' as awsui;
@use '../../../internal/generated/custom-css-properties/index.scss' as custom-props;
@use '../../constants' as constants;
@mixin desktop-only {
@include styles.media-breakpoint-up(styles.$breakpoint-x-small) {
@content;
}
}
@mixin mobile-only {
@include styles.media-breakpoint-down(styles.$breakpoint-x-small) {
@content;
}
}
@mixin grid-column-full-content-width {
grid-column: 1 / -1;
@include desktop-only {
grid-column: 2 / 5;
}
}
.root {
@include styles.styles-reset;
color: awsui.$color-text-body-default;
background-color: awsui.$color-background-layout-main;
#{custom-props.$maxContentWidth}: 100%;
display: grid;
// mobile grid
grid-template-areas:
'toolbar toolbar toolbar'
'. notifications .'
'. main .';
grid-template-columns:
awsui.$space-layout-content-horizontal
minmax(0, 1fr)
awsui.$space-layout-content-horizontal;
grid-template-rows: min-content min-content 1fr;
// desktop grid
@include desktop-only {
grid-template-areas:
'toolbar toolbar toolbar toolbar toolbar toolbar toolbar'
'navigation . notifications . sideSplitPanel tools global-tools'
'navigation . main . sideSplitPanel tools global-tools';
grid-template-columns:
min-content
minmax(#{awsui.$space-layout-content-horizontal}, 1fr)
minmax(0, var(#{custom-props.$maxContentWidth}))
minmax(#{awsui.$space-layout-content-horizontal}, 1fr)
min-content
min-content;
grid-template-rows: min-content min-content 1fr min-content;
&.has-adaptive-widths-default {
@each $breakpoint, $width in constants.$adaptive-content-widths {
@include styles.media-breakpoint-up($breakpoint) {
#{custom-props.$maxContentWidth}: $width;
}
}
}
&.has-adaptive-widths-dashboard {
@each $breakpoint, $width in constants.$dashboard-content-widths {
@include styles.media-breakpoint-up($breakpoint) {
#{custom-props.$maxContentWidth}: $width;
}
}
}
}
}
.navigation,
.tools,
.global-tools {
grid-row: 1 / -1;
grid-column: 1 / -1;
background: awsui.$color-background-container-content;
opacity: 1;
@include mobile-only {
inline-size: 100%;
}
}
.navigation {
z-index: constants.$drawer-z-index;
@include desktop-only {
grid-area: navigation;
inline-size: var(#{custom-props.$navigationWidth});
border-inline-end: awsui.$border-divider-section-width solid awsui.$color-border-layout;
}
@include mobile-only {
z-index: constants.$drawer-z-index-mobile;
}
}
.tools {
@include desktop-only {
grid-area: tools;
// workaround when new app layout and old widgets
/* stylelint-disable plugin/no-unsupported-browser-features */
&:not(:has(> [data-testid])) {
inline-size: var(#{custom-props.$toolsWidth});
&.tools-open {
border-inline-start: awsui.$border-divider-section-width solid awsui.$color-border-layout;
}
}
}
}
.global-tools {
@include desktop-only {
display: flex;
grid-area: global-tools;
}
}
.split-panel-side {
@include desktop-only {
grid-area: sideSplitPanel;
border-inline-start: awsui.$border-divider-section-width solid awsui.$color-border-layout;
opacity: 1;
}
}
.split-panel-bottom {
position: sticky;
z-index: 840;
align-self: end;
grid-area: main;
@include grid-column-full-content-width;
}
.panel-hidden {
border-block: none;
border-inline: none;
opacity: 0;
z-index: 0;
&.navigation,
&.tools,
&.global-tools {
inline-size: 0px;
}
}
.toolbar-container {
grid-area: toolbar;
block-size: 42px;
border-block-end: awsui.$border-divider-section-width solid awsui.$color-border-layout;
}
.notifications-container {
grid-area: notifications;
}
.notifications-background {
background: awsui.$color-background-layout-main;
grid-area: notifications;
@include grid-column-full-content-width;
}
.main-landmark {
// does not participate in the layout, rendered for accessibility grouping
display: contents;
}
.main {
grid-area: main;
margin-block-start: awsui.$space-scaled-s;
margin-block-end: awsui.$space-layout-content-bottom;
&-disable-paddings {
margin-block: 0;
@include grid-column-full-content-width;
}
}
.content-header {
margin-block-end: awsui.$space-content-header-padding-bottom;
}
.content {
display: contents;
}
/* stylelint-disable-next-line selector-combinator-disallowed-list, selector-max-universal */
.unfocusable-mobile * {
@include mobile-only {
visibility: hidden;
}
}