Skip to content

Commit b4be46c

Browse files
committed
Use more horizontal space on smaller screens
* Decrease size of left gutter, allowing hamburger to overlap content. * Full-bleed code blocks. * Full-bleed admonition blocks. * Tweak various mobile styles. * Improve transition effect when opening/closing sidebar.
1 parent 5889488 commit b4be46c

File tree

8 files changed

+106
-14
lines changed

8 files changed

+106
-14
lines changed

assets/css/content/admonition.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,17 @@
9696
border: 1px solid var(--inlineCodeBorder);
9797
color: var(--black);
9898
}
99+
100+
@media screen and (max-width: 768px) {
101+
.content-inner blockquote:is(.warning, .error, .info, .neutral, .tip) {
102+
margin-left: calc(-1 * var(--content-gutter));
103+
margin-right: calc(-1 * var(--content-gutter));
104+
padding-left: var(--content-gutter);
105+
padding-right: var(--content-gutter);
106+
border-radius: 0;
107+
}
108+
109+
.content-inner blockquote :is(h3, h4):is(.warning, .error, .info, .neutral, .tip) {
110+
margin: 0 calc(-1 * var(--content-gutter));
111+
}
112+
}

assets/css/content/cheatsheet.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
.page-cheatmd h2 {
2727
margin: var(--vertical-space) 0;
2828
column-span: all;
29-
padding-left: 3px;
3029
color: var(--gray700);
3130
font-weight: 500;
3231
}
@@ -38,13 +37,15 @@
3837
/* h3 */
3938

4039
.page-cheatmd h3 {
41-
overflow: hidden;
4240
margin: 0 0 1em;
43-
padding-left: 5px;
4441
color: var(--main);
4542
font-weight: 400;
4643
}
4744

45+
.page-cheatmd h3.section-heading .hover-link {
46+
display: none;
47+
}
48+
4849
.page-cheatmd section.h3 {
4950
min-width: 300px;
5051
margin: 0 0 calc(var(--vertical-space) * 2) 0;
@@ -224,7 +225,6 @@
224225
}
225226

226227
.page-cheatmd section.col-2-left > h2 {
227-
display: block;
228228
grid-column-end: span 2;
229229
}
230230

@@ -295,5 +295,9 @@
295295
.page-cheatmd section.list-6 > ul > li {
296296
flex: 0 0 50%;
297297
}
298+
299+
.page-cheatmd section.width-50 {
300+
width: 100%;
301+
}
298302
}
299303
}

assets/css/content/code.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,20 @@
7474
border-bottom: 0;
7575
border-radius: 2px;
7676
}
77+
78+
@media screen and (max-width: 768px) {
79+
.content-inner > pre:has(code),
80+
.content-inner section > pre:has(code) {
81+
margin-left: calc(-1 * var(--content-gutter));
82+
margin-right: calc(-1 * var(--content-gutter));
83+
}
84+
85+
.content-inner > pre code,
86+
.content-inner section > pre code {
87+
padding-left: var(--content-gutter);
88+
padding-right: var(--content-gutter);
89+
border-left: 0;
90+
border-right: 0;
91+
border-radius: 0;
92+
}
93+
}

assets/css/content/functions.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@
2424
position: relative;
2525
}
2626

27+
@media screen and (max-width: 768px) {
28+
.content-inner .detail-header {
29+
margin-left: calc(-1 * var(--content-gutter));
30+
margin-right: calc(-1 * var(--content-gutter));
31+
padding-left: var(--content-gutter);
32+
padding-right: var(--content-gutter);
33+
border-left: 0;
34+
border-top: 3px solid var(--main);
35+
}
36+
}
37+
2738
.content-inner .detail-header .note {
2839
float: right;
2940
}
@@ -54,6 +65,12 @@
5465
border: none;
5566
}
5667

68+
@media screen and (max-width: 768px) {
69+
.content-inner .detail-header a.detail-link {
70+
margin-left: -.5em;
71+
}
72+
}
73+
5774
.content-inner .specs pre {
5875
font-family: var(--monoFontFamily);
5976
font-size: .9em;
@@ -72,6 +89,12 @@
7289
margin: 1.2em 0 3em 1.2em;
7390
}
7491

92+
@media screen and (max-width: 768px) {
93+
.content-inner .docstring {
94+
margin-left: 0;
95+
}
96+
}
97+
7598
.content-inner .docstring:is(h2, h3, h4, h5) {
7699
font-weight: 700;
77100
}

assets/css/content/general.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,19 @@
146146
opacity: 0;
147147
padding: .3em .6em .6em;
148148
line-height: 1em;
149-
margin-left: -2.7em;
149+
margin-left: -2.4em;
150150
text-decoration: none;
151151
border: none;
152152
font-size: 16px;
153153
vertical-align: middle;
154154
}
155155

156-
.content-inner .detail :is(h1, h2, h3, h4, h5, h6).section-heading {
157-
margin-left: .3em;
156+
@media screen and (max-width: 768px) {
157+
.content-inner .section-heading a.hover-link {
158+
float: right;
159+
margin: .5em 0 .5em .5em;
160+
padding: .3em;
161+
}
158162
}
159163

160164
.content-inner .app-vsn {
@@ -179,3 +183,9 @@
179183
line-height: 24px;
180184
font-weight: 400;
181185
}
186+
187+
@media screen and (max-width: 768px) {
188+
.content-inner :is(ol, ul) {
189+
padding-left: calc(1.5 * var(--content-gutter));
190+
}
191+
}

assets/css/custom-props/common.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
:root {
2+
/* Layout & Whitespace */
3+
--content-width: 949px;
4+
--content-gutter: 60px;
5+
26
/* Font Families */
37
--serifFontFamily: 'Merriweather', 'Book Antiqua', Georgia, 'Century Schoolbook', serif;
48
--sansFontFamily: 'Lato', sans-serif;
@@ -37,3 +41,10 @@
3741
--black-opacity-10: hsla( 0, 0%, 0%, 10%);
3842
--black-opacity-50: hsla( 0, 0%, 0%, 50%);
3943
}
44+
45+
@media screen and (max-width: 768px) {
46+
:root {
47+
--content-width: 100%;
48+
--content-gutter: 20px;
49+
}
50+
}

assets/css/layout.css

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ body {
4343
top: 7px;
4444
transition: color .3s ease-in-out, transform .15s ease-out .1s, opacity .15s ease-out .1s;
4545
will-change: transform;
46-
transform: translateX(250px);
4746
}
4847

4948
.content {
@@ -58,6 +57,15 @@ body.sidebar-opening .sidebar-button {
5857
transition: transform .3s ease-in-out;
5958
}
6059

60+
body:is(.sidebar-opening, .sidebar-closing) .sidebar-button {
61+
transition: all .3s ease-in-out;
62+
}
63+
64+
body:is(.sidebar-opening, .sidebar-opened) .sidebar-button {
65+
transform: translateX(250px);
66+
top: 6px;
67+
}
68+
6169
body.sidebar-opening .sidebar {
6270
left: 0;
6371
transition: left .3s ease-in-out;
@@ -73,6 +81,10 @@ body.sidebar-closing .sidebar-button {
7381
transform: translateX(0);
7482
}
7583

84+
body:is(.sidebar-closing, .sidebar-closed) .sidebar-button {
85+
left: calc(var(--content-gutter) - var(--sidebar-button-x-padding));
86+
}
87+
7688
body.sidebar-closing .sidebar {
7789
left: -300px;
7890
transition: left .3s ease-in-out;
@@ -85,7 +97,7 @@ body.sidebar-closing .content {
8597
}
8698

8799
body.sidebar-closed .sidebar-button {
88-
transition: transform .3s ease-in-out;
100+
transition: transform 0.3s ease-in-out;
89101
transform: translateY(-8px);
90102
}
91103

@@ -110,9 +122,9 @@ body.search-focused .sidebar-search .search-close-button {
110122
}
111123

112124
.content-inner {
113-
max-width: 949px;
125+
max-width: var(--content-width);
114126
margin: 0 auto;
115-
padding: 3px 60px;
127+
padding: 3px var(--content-gutter);
116128
}
117129

118130
.content-inner:focus {
@@ -131,8 +143,8 @@ body.search-focused .sidebar-search .search-close-button {
131143
}
132144

133145
.content-inner {
134-
padding: 27px 20px 27px 40px;
135-
max-width: 100%;
146+
padding-top: 27px;
147+
padding-bottom: 27px;
136148
overflow-x: auto;
137149
}
138150
}

assets/css/sidebar.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,11 @@
406406
}
407407

408408
.sidebar-button {
409+
--sidebar-button-x-padding: 11px;
409410
cursor: pointer;
410411
background-color: transparent;
411412
border: none;
412-
padding: 15px 11px;
413+
padding: 15px var(--sidebar-button-x-padding);
413414
font-size: 16px;
414415
}
415416

0 commit comments

Comments
 (0)