Skip to content

Commit 703c199

Browse files
committed
fixed header on mobile and tablet layout
1 parent 0934896 commit 703c199

File tree

3 files changed

+116
-137
lines changed

3 files changed

+116
-137
lines changed

src/css/header.css

Lines changed: 107 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ body {
300300
z-index: var(--z-index-navbar);
301301
width: 72rem;
302302
margin: 0 auto;
303+
display: flex;
303304
}
304305

305306
.sections-navbar a {
@@ -309,6 +310,11 @@ body {
309310
.sections-navbar-brand {
310311
padding-left: 1rem;
311312
flex: 46%;
313+
padding-top: 0.3rem !important;
314+
}
315+
316+
.sections-navbar-menu {
317+
flex: auto;
312318
}
313319

314320
.sections-navbar-brand .sections-navbar-item:first-child,
@@ -331,12 +337,13 @@ body {
331337
width: 3rem;
332338
margin-left: auto;
333339
padding: 0;
334-
display: none;
335340
flex-direction: column;
336341
align-items: center;
337342
justify-content: center;
338343
min-width: 0;
339344
margin-right: 12rem;
345+
/* hidden in new layout */
346+
display: none;
340347
}
341348

342349
.sections-navbar-burger span {
@@ -368,9 +375,12 @@ body {
368375
.sections-navbar-item,
369376
.sections-navbar-link {
370377
color: var(--navbar-menu-font-color);
371-
display: block;
378+
/* display: block; */
372379
line-height: var(--doc-line-height);
373380
padding: 0.5rem 1rem;
381+
display: flex;
382+
position: relative;
383+
flex: none;
374384
}
375385

376386
.sections-docu-title {
@@ -381,6 +391,15 @@ body {
381391
padding: 0;
382392
}
383393

394+
.sections-navbar-item:not(.has-dropdown),
395+
.sections-navbar-link {
396+
align-items: center;
397+
}
398+
399+
.sections-navbar-item.is-hoverable:hover .navbar-dropdown {
400+
display: block;
401+
}
402+
384403
.sections-navbar-item .icon {
385404
width: 1.25rem;
386405
height: 1.25rem;
@@ -398,11 +417,6 @@ body {
398417
padding-right: 2.5em;
399418
}
400419

401-
.sections-navbar-dropdown .sections-navbar-item {
402-
padding-left: 1.5rem;
403-
padding-right: 1.5rem;
404-
}
405-
406420
.sections-navbar-divider {
407421
background-color: var(--navbar-menu-border-color);
408422
border: none;
@@ -426,10 +440,7 @@ body {
426440
display: flex;
427441
gap: 1.25rem;
428442
list-style: none;
429-
}
430-
431-
.sections-nav-list-mobile {
432-
list-style: none;
443+
padding-left: 6rem;
433444
}
434445

435446
.sections-nav-list > li {
@@ -438,6 +449,12 @@ body {
438449
margin-top: 0.1rem;
439450
}
440451

452+
/* Mobile navigation */
453+
454+
.sections-nav-list-mobile {
455+
list-style: none;
456+
}
457+
441458
.sections-nav-list-mobile > li {
442459
text-decoration: none;
443460
margin-right: 1rem;
@@ -531,13 +548,90 @@ body {
531548
font-size: 1.25rem;
532549
}
533550

551+
/* sections-navbar-dropdown that is probably not used */
552+
553+
.sections-navbar-dropdown {
554+
background: var(--navbar-menu-background);
555+
border: 1px solid var(--navbar-menu-border-color);
556+
border-top: none;
557+
border-radius: 0 0 0.25rem 0.25rem;
558+
display: none;
559+
top: 100%;
560+
left: 0;
561+
min-width: 100%;
562+
position: absolute;
563+
}
564+
565+
.sections-navbar-dropdown .sections-navbar-item {
566+
padding-left: 1.5rem;
567+
padding-right: 1.5rem;
568+
}
569+
570+
.sections-navbar-dropdown .navbar-item {
571+
padding: 0.5rem 3rem 0.5rem 1rem;
572+
white-space: nowrap;
573+
}
574+
575+
.sections-navbar-dropdown .navbar-item:last-child {
576+
border-radius: inherit;
577+
}
578+
579+
.sections-navbar-dropdown.is-right {
580+
left: auto;
581+
right: 0;
582+
}
583+
584+
.sections-navbar-dropdown a.navbar-item:hover {
585+
background: var(--navbar-menu_hover-background);
586+
}
587+
/* .sections-navbar-link::after {
588+
border-width: 0 0 1px 1px;
589+
border-style: solid;
590+
content: "";
591+
display: block;
592+
height: 0.5em;
593+
pointer-events: none;
594+
position: absolute;
595+
transform: rotate(-45deg);
596+
width: 0.5em;
597+
margin-top: -0.375em;
598+
right: 1.125em;
599+
top: 50%;
600+
} */
601+
602+
/* .sections-navbar-end > .navbar-item,
603+
.sections-navbar-end .navbar-link {
604+
color: var(--navbar-font-color);
605+
} */
606+
607+
/* .sections-navbar-end > a.navbar-item:hover,
608+
.sections-navbar-end .navbar-link:hover,
609+
.sections-navbar-end .navbar-item.has-dropdown:hover .navbar-link {
610+
background: var(--navbar_hover-background);
611+
color: var(--navbar-font-color);
612+
}
613+
614+
.sections-navbar-end .navbar-link::after {
615+
border-color: currentColor;
616+
} */
617+
534618
@media screen and (max-width: 1440px) {
619+
.sections-navbar-menu {
620+
margin-left: unset !important;
621+
}
622+
}
623+
624+
@media screen and (max-width: 1024px) {
535625
.sections-navbar {
536626
padding-left: 2.5rem;
537627
}
538628

539-
.sections-navbar-menu {
540-
margin-left: unset !important;
629+
.sections-nav-list {
630+
padding-left: unset !important;
631+
}
632+
633+
.sections-navbar-brand {
634+
flex: 10% !important;
541635
}
542636
}
543637

@@ -605,130 +699,6 @@ body {
605699
}
606700
}
607701

608-
@media screen and (min-width: 1024px) {
609-
.sections-navbar-burger {
610-
display: none;
611-
}
612-
613-
.sections-navbar,
614-
.sections-navbar-menu,
615-
.sections-navbar-end {
616-
display: flex;
617-
}
618-
619-
.sections-navbar-menu {
620-
flex: auto;
621-
}
622-
623-
.sections-navbar-end {
624-
margin-left: auto;
625-
}
626-
627-
.sections-navbar-item,
628-
.sections-navbar-link {
629-
display: flex;
630-
position: relative;
631-
flex: none;
632-
}
633-
634-
.sections-navbar-item:not(.has-dropdown),
635-
.sections-navbar-link {
636-
align-items: center;
637-
}
638-
639-
.sections-navbar-item.is-hoverable:hover .navbar-dropdown {
640-
display: block;
641-
}
642-
643-
.sections-navbar-link::after {
644-
border-width: 0 0 1px 1px;
645-
border-style: solid;
646-
content: "";
647-
display: block;
648-
height: 0.5em;
649-
pointer-events: none;
650-
position: absolute;
651-
transform: rotate(-45deg);
652-
width: 0.5em;
653-
margin-top: -0.375em;
654-
right: 1.125em;
655-
top: 50%;
656-
}
657-
658-
.sections-navbar-end > .navbar-item,
659-
.sections-navbar-end .navbar-link {
660-
color: var(--navbar-font-color);
661-
}
662-
663-
.sections-navbar-end > a.navbar-item:hover,
664-
.sections-navbar-end .navbar-link:hover,
665-
.sections-navbar-end .navbar-item.has-dropdown:hover .navbar-link {
666-
background: var(--navbar_hover-background);
667-
color: var(--navbar-font-color);
668-
}
669-
670-
.sections-navbar-end .navbar-link::after {
671-
border-color: currentColor;
672-
}
673-
674-
.sections-navbar-dropdown {
675-
background: var(--navbar-menu-background);
676-
border: 1px solid var(--navbar-menu-border-color);
677-
border-top: none;
678-
border-radius: 0 0 0.25rem 0.25rem;
679-
display: none;
680-
top: 100%;
681-
left: 0;
682-
min-width: 100%;
683-
position: absolute;
684-
}
685-
686-
.sections-navbar-dropdown .navbar-item {
687-
padding: 0.5rem 3rem 0.5rem 1rem;
688-
white-space: nowrap;
689-
}
690-
691-
.sections-navbar-dropdown .navbar-item:last-child {
692-
border-radius: inherit;
693-
}
694-
695-
.sections-navbar-dropdown.is-right {
696-
left: auto;
697-
right: 0;
698-
}
699-
700-
.sections-navbar-dropdown a.navbar-item:hover {
701-
background: var(--navbar-menu_hover-background);
702-
}
703-
704-
.sections-navbar-mobile {
705-
display: none;
706-
}
707-
}
708-
709-
@media screen and (min-width: 1024px) {
710-
.sections-navbar-menu {
711-
margin-left: -7rem;
712-
}
713-
714-
.sections-navbar {
715-
width: unset !important;
716-
}
717-
718-
.sections-navbar-brand {
719-
padding-left: 3.25rem !important;
720-
padding-top: 0.3rem !important;
721-
}
722-
723-
.sectionWhite-left {
724-
padding-left: 1rem;
725-
}
726-
727-
.sections-page > h1 {
728-
padding-left: 2.5rem !important;
729-
}
730-
}
731-
732702
@media screen and (max-width: 768px) {
733703
.sections-header {
734704
display: none;

src/css/nav.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
.nav-container.is-active {
3636
visibility: visible;
37+
height: 100% !important;
3738
}
3839

3940
.nav {

src/css/sections.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,14 @@
315315
.doc .imageblock img {
316316
max-width: 110%;
317317
}
318+
319+
.sectionWhite-left {
320+
padding-left: 1rem;
321+
}
322+
323+
.sections-page > h1 {
324+
padding-left: 2.5rem !important;
325+
}
318326
}
319327

320328
@media screen and (max-width: 768px) {

0 commit comments

Comments
 (0)