Skip to content

Commit ff48a10

Browse files
Fix: mobile navigation title visibility remove the
custom double nav bar and properly utilize Material's native navigation.tabs feature. Signed-off-by: codeEvolveZenith345 <suntiwari3495@gmail.com>
1 parent fbaa917 commit ff48a10

File tree

2 files changed

+139
-29
lines changed

2 files changed

+139
-29
lines changed

docs/stylesheets/extra.css

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,4 +671,143 @@ a.md-header__button.md-logo img {
671671
.pipe {
672672
display: none;
673673
}
674+
}
675+
676+
/* Mobile viewport: up to 76.1875em (1220px) */
677+
@media screen and (max-width: 76.1875em) {
678+
679+
.md-header__topic:first-child {
680+
display: flex !important;
681+
opacity: 1 !important;
682+
transform: translateX(0) !important;
683+
transition: none !important;
684+
pointer-events: auto !important;
685+
}
686+
687+
.md-header__topic:last-child {
688+
display: none !important;
689+
}
690+
691+
.md-header__title {
692+
display: flex !important;
693+
flex-shrink: 1;
694+
min-width: 0;
695+
}
696+
697+
.md-header__title[data-md-component="header-title"] {
698+
visibility: visible !important;
699+
}
700+
701+
[data-md-component="header"][data-md-state="shadow"] .md-header__topic:first-child {
702+
opacity: 1 !important;
703+
transform: translateX(0) !important;
704+
z-index: 1;
705+
}
706+
707+
.md-header__inner {
708+
display: flex;
709+
align-items: center;
710+
}
711+
712+
.md-tabs {
713+
width: 100%;
714+
}
715+
716+
.md-nav--primary .md-nav__title {
717+
background-color: var(--md-primary-fg-color);
718+
color: var(--md-primary-bg-color);
719+
}
720+
721+
.md-nav--primary .md-nav__item {
722+
border-top: 0.05rem solid var(--md-default-fg-color--lightest);
723+
}
724+
}
725+
726+
/* Tablet adjustments: 60em to 76.1875em (960px to 1220px) */
727+
@media screen and (min-width: 60em) and (max-width: 76.1875em) {
728+
729+
.md-header__title {
730+
max-width: 40%;
731+
flex-shrink: 1;
732+
}
733+
734+
.md-tabs {
735+
margin-top: 0;
736+
}
737+
738+
.md-header__topic:last-child {
739+
display: flex !important;
740+
max-width: 100%;
741+
}
742+
}
743+
744+
/* Small mobile: up to 30em (480px) */
745+
@media screen and (max-width: 30em) {
746+
747+
.md-header__button.md-logo {
748+
padding: 0.2rem;
749+
}
750+
751+
.md-header__button.md-logo img,
752+
.md-header__button.md-logo svg {
753+
width: 2.5rem;
754+
height: 2rem;
755+
}
756+
757+
.md-header__title {
758+
font-size: 0.9rem;
759+
}
760+
761+
.md-header__ellipsis {
762+
margin-left: 0.2rem;
763+
margin-right: 0.2rem;
764+
}
765+
766+
.md-header__button[for="__drawer"] {
767+
margin-right: 0.2rem;
768+
}
769+
}
770+
771+
/* Desktop: Maintain existing behavior above 76.1875em (1220px) */
772+
@media screen and (min-width: 76.25em) {
773+
774+
/* Restore default Material behavior for desktop */
775+
.md-header__topic:first-child {
776+
display: flex;
777+
}
778+
779+
.md-header__topic:last-child {
780+
display: flex;
781+
}
782+
783+
/* Desktop title gets full width */
784+
.md-header__title {
785+
max-width: 100%;
786+
}
787+
}
788+
789+
/* Update existing 1024px media query for removed hardcoded navigation */
790+
@media (max-width: 1024px) {
791+
[dir=ltr] .md-tabs__list {
792+
margin-left: 0 !important; /* Override existing 5rem to 0 */
793+
}
794+
}
795+
796+
/* Accessibility improvements */
797+
@media (prefers-reduced-motion: reduce) {
798+
.md-header__topic {
799+
transition: none !important;
800+
}
801+
}
802+
803+
/* Print styles - ensure title is visible */
804+
@media print {
805+
.md-header__topic:first-child {
806+
display: block !important;
807+
opacity: 1 !important;
808+
}
809+
810+
.md-header__topic:last-child {
811+
display: none !important;
812+
}
674813
}

overrides/partials/header.html

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -84,35 +84,6 @@
8484
{% include "partials/javascripts/palette.html" %}
8585
{% endif %}
8686

87-
<!-- Top Nav -->
88-
<ul class="md-tabs__list mr-30">
89-
<li class="md-tabs__item">
90-
<a href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}" class="md-tabs__link">
91-
Home
92-
</a>
93-
</li>
94-
<li class="md-tabs__item">
95-
<a href="/docs/" class="md-tabs__link">
96-
Docs
97-
</a>
98-
</li>
99-
<li class="md-tabs__item">
100-
<a href="/about/testimonials/" class="md-tabs__link">
101-
About
102-
</a>
103-
</li>
104-
<li class="md-tabs__item">
105-
<a href="/blog/" class="md-tabs__link">
106-
Blog
107-
</a>
108-
</li>
109-
<li class="md-tabs__item">
110-
<a href="/community/" class="md-tabs__link">
111-
Community
112-
</a>
113-
</li>
114-
</ul>
115-
11687
<!-- Site language selector -->
11788
{% if config.extra.alternate %}
11889
{% include "partials/alternate.html" %}

0 commit comments

Comments
 (0)