-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy path_layouts_docs.scss
99 lines (84 loc) · 2.75 KB
/
_layouts_docs.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
@mixin vf-l-docs {
$l-documentation-sidebar-width: 15rem !default;
// we switch to full screen layout (with side navigation fixed to left side)
// when screen is big enough to fit 12 column grid and side navigation
$breakpoint-full-screen-layout: calc($breakpoint-large + $l-documentation-sidebar-width);
// root element for the documentation layout
.l-docs,
// root element for that can be used on a nested container to create a subgrid aligned with the main documentation layout grid
.l-docs__subgrid {
// container for the site global navigation header
.l-docs__header {
grid-area: header;
}
// left side container, for side navigation
.l-docs__sidebar {
grid-area: sidebar;
}
// main content title container
// will appear above table of contents on medium screens
.l-docs__title {
grid-area: title;
}
// metadata container (for table of contents, etc)
// will appear between title and content on medium screens
// and on the right side on large screens
.l-docs__meta {
grid-area: meta;
}
// main content container
// will appear below table of contents on medium screens
.l-docs__main {
grid-area: main;
}
// container for site global footer
.l-docs__footer {
grid-area: footer;
}
}
@media (min-width: $breakpoint-large) {
.l-docs {
display: grid;
grid-gap: 0;
grid-template-areas:
'header header'
'sidebar title'
'sidebar meta'
'sidebar main'
'footer footer';
grid-template-columns: $l-documentation-sidebar-width minmax(0, 1fr);
grid-template-rows: auto auto auto 1fr auto; // stretch main content to fill the space
width: 100%;
}
.l-docs__subgrid {
display: grid;
grid-template-areas: 'sidebar main meta';
grid-template-columns: $l-documentation-sidebar-width minmax(0, 1fr) min-content;
width: 100%;
}
}
@media (min-width: $breakpoint-full-screen-layout) {
.l-docs {
grid-template-areas:
'header header header'
'sidebar title meta'
'sidebar main meta'
'footer footer footer';
grid-template-columns: $l-documentation-sidebar-width minmax(0, 1fr) $l-documentation-sidebar-width;
grid-template-rows: auto auto 1fr auto; // stretch main content to fill the space
.l-docs__content {
display: contents;
}
}
.l-docs__subgrid {
grid-template-columns: $l-documentation-sidebar-width minmax(0, 1fr) $l-documentation-sidebar-width;
}
// on largest screens we want to keep the table of contents sticky
.l-docs__sticky-container {
max-height: 100vh;
overflow-y: auto;
position: sticky;
top: 0;
}
}
}