-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.layout.css
More file actions
208 lines (180 loc) · 4.88 KB
/
Copy pathglobal.layout.css
File metadata and controls
208 lines (180 loc) · 4.88 KB
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
202
203
204
205
206
207
208
/*! mCSS v1.4.0 | MIT | https://mcss.dev */
/*
SETTINGS MEDIA QUERIES
https://github.com/argyleink/open-props/blob/main/src/props.media.css
https://open-props.style/#media-queries
Can't use var() inside media queries 🤦♂️
https://stackoverflow.com/questions/40722882/css-native-variables-not-working-in-media-queries/47212942#47212942
so breakpoints are not in theme.default.tokens.css
xxs: 240px
xs: 360px
sm: 480px
md: 768px
lg: 1024px
xl: 1440px
xxl: 1920px
*/
/* https://github.com/postcss/postcss-mixins */
/* Example */
/* truncate single line of text and adds … */
@layer global {
/*
Page-level layout scaffolds. Every variant extends the .layout base:
<body class="layout layout-sidebar">
<header>…</header>
<div class="layout_content">
<aside class="layout_content_aside">…</aside>
<main class="layout_content_main">…</main>
</div>
<footer>…</footer>
</body>
Widths come from the layout tokens in theme.default.ui.css:
--layout-content-width, --layout-aside-width, --layout-toc-width.
*/
/* App shell: header / content / footer, with a sticky footer. Base for
every variant below, also usable on its own. */
.layout {
display: flex;
flex-direction: column;
width: 100vw;
min-height: 100vh;
.layout_content {
flex: 1;
}
}
/* The main column is a size container: container-responsive components
(Tiles) pick their column count from it instead of the viewport.
Named, so custom rules can target it with @container main. */
.layout_content_main {
container: main / inline-size;
}
/* Single centered reading column: articles, blog posts, legal pages. */
.layout-centered {
.layout_content {
display: grid;
gap: var(--sm3);
grid-template-columns: 1fr minmax(0, var(--layout-content-width)) 1fr;
margin-top: var(--lg1);
margin-bottom: var(--sm1);
@media (width >= 768px) {
margin-top: var(--xl3);
margin-bottom: var(--md3);
gap: var(--md3);
}
}
.layout_content_main {
grid-column: 2;
}
}
/* Aside + main: settings pages, simple docs, blogs with a nav column.
Single column below --md, aside following source order. */
.layout-sidebar {
.layout_content {
@media (width >= 768px) {
display: grid;
grid-template-columns: var(--layout-aside-width) minmax(0, 1fr);
}
}
.layout_content_main {
padding: var(--sm2);
@media (width >= 768px) {
grid-row: 1;
grid-column: 2;
padding: var(--lg1) var(--md2);
}
}
.layout_content_aside {
@media (width >= 768px) {
grid-row: 1;
grid-column: 1;
padding: var(--lg1) var(--md3);
}
}
}
/* Moves the aside to the reading end ("end", not "right": columns follow
the writing direction). Compose with .layout-sidebar. */
.layout-sidebar-end {
.layout_content {
@media (width >= 768px) {
grid-template-columns: minmax(0, 1fr) var(--layout-aside-width);
}
}
.layout_content_main {
@media (width >= 768px) {
grid-column: 1;
}
}
.layout_content_aside {
@media (width >= 768px) {
grid-column: 2;
}
}
}
/* Documentation shell: nav aside + main + table of contents. One column
below --md with both asides hidden (put that navigation in your header
menu), nav + main from --md, TOC joins from --lg. */
.layout-docs {
.layout_content {
@media (width >= 768px) {
display: grid;
grid-template-columns: var(--layout-aside-width) minmax(0, 1fr);
}
@media (width >= 1024px) {
grid-template-columns:
var(--layout-aside-width)
minmax(0, var(--layout-content-width))
var(--layout-toc-width);
}
}
.layout_content_main {
padding: var(--sm2);
@media (width >= 768px) {
grid-row: 1;
grid-column: 2;
padding: var(--lg1) var(--md2);
}
}
.layout_content_aside {
display: none;
@media (width >= 768px) {
display: block;
grid-row: 1;
grid-column: 1;
padding: var(--lg1) var(--md3);
}
}
/* Compose on the second aside: class="layout_content_aside
layout_content_aside-toc". Same specificity as the base element rule,
so these declarations must stay after it. */
.layout_content_aside-toc {
@media (width >= 768px) {
display: none;
}
@media (width >= 1024px) {
display: block;
grid-row: 1;
grid-column: 3;
padding: var(--lg1) var(--md3);
}
}
}
/* Two equal panes, stacked below --md: auth screens, "image + content"
landings. Panes are the direct children of .layout_content. */
.layout-split {
.layout_content {
display: grid;
@media (width >= 768px) {
grid-template-columns: 1fr 1fr;
}
}
}
/* Full-viewport cover with centered content: landing, 404, coming soon.
dvh so mobile browser chrome never hides the content. */
.layout-cover {
min-height: 100dvh;
.layout_content {
display: grid;
place-items: center;
}
}
}