Skip to content

Commit cfefb45

Browse files
committed
Extract mobile topbar queries into a new section
1 parent b769b3e commit cfefb45

File tree

2 files changed

+34
-52
lines changed

2 files changed

+34
-52
lines changed

.stylelintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ rules:
2020
rule-empty-line-before:
2121
- always
2222
- except: ['after-single-line-comment', 'first-nested']
23+
ignore: ['after-comment']
2324
property-case: lower
2425
value-keyword-case: lower
2526
string-quotes: single

sigma9.css

Lines changed: 33 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ a.newpage {
9595
left: 1em;
9696
bottom: 0;
9797
z-index: 0;
98+
max-width: 90%;
9899
}
99100

100101
body {
@@ -327,10 +328,32 @@ sup {
327328
color: #a01;
328329
}
329330

330-
.top-bar ul li:last-of-type ul {
331+
/* The last dropdown in the topbar should point to the left to avoid
332+
* potentially overflowing offscreen */
333+
.top-bar ul li:last-of-type ul,
334+
.mobile-top-bar ul li:last-of-type ul {
331335
right: 0;
332336
}
333337

338+
@media (max-width: 767px) {
339+
/* On mobile, show the mobile top bar instead of the regular one */
340+
.mobile-top-bar {
341+
display: block;
342+
}
343+
344+
.top-bar {
345+
display: none;
346+
}
347+
}
348+
349+
@media (max-width: 385px) {
350+
/* At very small screen sizes, increase the width of the mobile top bar to
351+
* avoid the links overflowing onto a new line */
352+
.mobile-top-bar {
353+
width: 100%;
354+
}
355+
}
356+
334357
/* IE7 HACK */
335358
#top-bar ul > li > ul {
336359
*margin-top: -4px;
@@ -1141,10 +1164,6 @@ img, embed, video, object, iframe, table {
11411164
float: left;
11421165
}
11431166

1144-
.mobile-top-bar ul li:last-of-type ul {
1145-
right: 0;
1146-
}
1147-
11481167
span, a {
11491168
word-break: break-all;
11501169
}
@@ -1168,17 +1187,10 @@ img, embed, video, object, iframe, table {
11681187
width: 100%;
11691188
}
11701189

1171-
#header, .mobile-top-bar {
1190+
#header {
11721191
max-width: 90%;
1173-
}
1174-
1175-
.top-bar {
1176-
display: none;
1177-
}
1178-
1179-
.mobile-top-bar {
1180-
display: block;
1181-
padding: 0;
1192+
background-position: 0 5.5em;
1193+
background-size: 55px 55px;
11821194
}
11831195

11841196
.page-options-bottom a {
@@ -1197,11 +1209,6 @@ img, embed, video, object, iframe, table {
11971209
font-size: .8em;
11981210
}
11991211

1200-
#header {
1201-
background-position: 0 5.5em;
1202-
background-size: 55px 55px;
1203-
}
1204-
12051212
#header h1, #header h2 {
12061213
margin-left: 66px;
12071214
}
@@ -1250,10 +1257,6 @@ img, embed, video, object, iframe, table {
12501257
max-width: 100%;
12511258
}
12521259

1253-
.mobile-top-bar {
1254-
width: 100%;
1255-
}
1256-
12571260
#top-bar li a {
12581261
padding: 10px .5em;
12591262
}
@@ -1269,16 +1272,10 @@ img, embed, video, object, iframe, table {
12691272
margin: 0 2em 0 2em;
12701273
}
12711274

1272-
#header, .mobile-top-bar {
1275+
#header {
12731276
max-width: 90%;
1274-
}
1275-
1276-
.top-bar {
1277-
display: none;
1278-
}
1279-
1280-
.mobile-top-bar {
1281-
display: block;
1277+
background-position: .5em 4.5em;
1278+
background-size: 66px 66px;
12821279
}
12831280

12841281
.page-options-bottom a {
@@ -1297,11 +1294,6 @@ img, embed, video, object, iframe, table {
12971294
font-size: .85em;
12981295
}
12991296

1300-
#header {
1301-
background-position: .5em 4.5em;
1302-
background-size: 66px 66px;
1303-
}
1304-
13051297
#header h1, #header h2 {
13061298
margin-left: 80px;
13071299
}
@@ -1334,16 +1326,10 @@ img, embed, video, object, iframe, table {
13341326
margin: 0 3em 0 2em;
13351327
}
13361328

1337-
#header, .mobile-top-bar {
1329+
#header {
13381330
max-width: 90%;
1339-
}
1340-
1341-
.top-bar {
1342-
display: none;
1343-
}
1344-
1345-
.mobile-top-bar {
1346-
display: block;
1331+
background-position: 1em 4em;
1332+
background-size: 77px 77px;
13471333
}
13481334

13491335
.page-options-bottom a {
@@ -1358,11 +1344,6 @@ img, embed, video, object, iframe, table {
13581344
font-size: .9em;
13591345
}
13601346

1361-
#header {
1362-
background-position: 1em 4em;
1363-
background-size: 77px 77px;
1364-
}
1365-
13661347
#header h1, #header h2 {
13671348
margin-left: 93px;
13681349
}

0 commit comments

Comments
 (0)