Skip to content

Commit 04a8436

Browse files
Fix problems with logo disply in dark mode
1 parent c43a3ba commit 04a8436

8 files changed

Lines changed: 74 additions & 39 deletions

File tree

assets/_includes/_nav.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<nav>
2-
<img src="/global/OSPedia-logo.svg" alt="logo" height="70%" />
2+
<div class="ospedia-logo"></div>
33
<img src="/global/OSPedia-favicon.svg" alt="logo" height="70%" />
44
<pagefind-input></pagefind-input>
55
<img src="/global/Images/light-dark-mode-button.png" alt="toggle dark mode" class="dark-mode-toggle" />
@@ -26,6 +26,6 @@
2626
<a href="/about.html" class="nav">About</a>
2727
</li>
2828
</ul>
29-
<img src="/global/OSPedia-logo.svg" alt="logo" class="hamburger-menu-logo" />
29+
<div class="ospedia-logo hamburger-menu-logo"></div>
3030
</div>
3131
<div class="hamburger-menu-blur"></div>

assets/global/scss/_mixins.scss

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
--border-radius: 15px;
2020
--border: none;
2121
--backdrop-filter: blur(5px);
22+
--logo: url("/global/OSPedia-logo.svg");
2223
--vh: 99dvh;
2324

2425
@media (prefers-color-scheme: dark) {
@@ -27,6 +28,7 @@
2728
--text-color: white;
2829
--link-color: #1e99ff;
2930
--link-hover-color: #85c8ff;
31+
--logo: url("/global/OSPedia-logo-dark.svg");
3032
}
3133
}
3234

@@ -46,6 +48,12 @@
4648
padding-left: 18px;
4749
}
4850

51+
div.ospedia-logo {
52+
background-image: var(--logo);
53+
background-position: center;
54+
background-repeat: no-repeat;
55+
}
56+
4957
@media (min-width: 769px) {
5058
html {
5159
height: 100%;
@@ -142,6 +150,7 @@
142150
// Article styles
143151

144152
@mixin article() {
153+
145154
main,
146155
div.contents,
147156
div.extras {
@@ -215,6 +224,7 @@
215224
}
216225

217226
@media (min-width: 1440px) {
227+
218228
main,
219229
div.contents,
220230
div.extras {
@@ -597,19 +607,25 @@ div#back-to-top {
597607
height: 5rem;
598608
list-style: none;
599609

610+
.ospedia-logo {
611+
width: 8rem;
612+
height: 70%;
613+
background-size: auto 90%;
614+
}
615+
600616
ul {
601617
flex-wrap: nowrap;
602618
display: none;
603619
}
604620

605-
ul > li.nav {
621+
ul>li.nav {
606622
list-style: none;
607623
margin-right: 20px;
608624
display: inline-block;
609625
}
610626

611-
ul > li.nav a,
612-
ul > li.nav a:visited {
627+
ul>li.nav a,
628+
ul>li.nav a:visited {
613629
text-decoration: none;
614630
color: var(--link-color);
615631

@@ -623,12 +639,12 @@ div#back-to-top {
623639
}
624640

625641
// full logo
626-
img:nth-child(1) {
642+
div.ospedia-logo {
627643
display: none;
628644
}
629645

630646
// icon
631-
img:nth-child(2) {
647+
img:nth-child(1) {
632648
display: block;
633649
}
634650

@@ -637,7 +653,7 @@ div#back-to-top {
637653
}
638654
}
639655

640-
nav > * {
656+
nav>* {
641657
padding: calc(2 / 3 * var(--padding));
642658
}
643659

@@ -760,6 +776,7 @@ div#back-to-top {
760776
color: var(--text-color);
761777
}
762778
}
779+
763780
img.hamburger-menu-icon {
764781
width: 2rem;
765782
height: 2rem;
@@ -812,10 +829,13 @@ div#back-to-top {
812829
text-decoration: none;
813830
}
814831

815-
img.hamburger-menu-logo {
832+
div.hamburger-menu-logo {
816833
position: absolute;
817834
width: 90%;
835+
height: 4rem;
818836
bottom: 2%;
837+
background-position: center;
838+
background-size: 100% auto;
819839
}
820840

821841
&.show {
@@ -830,11 +850,11 @@ div#back-to-top {
830850

831851
@media (min-width: 769px) {
832852
nav {
833-
img:nth-child(1) {
853+
div.ospedia-logo {
834854
display: block;
835855
}
836856

837-
img:nth-child(2) {
857+
img:nth-child(1) {
838858
display: none;
839859
}
840860

@@ -863,13 +883,10 @@ div#back-to-top {
863883

864884
@mixin searchbar() {
865885
pagefind-input {
866-
--pf-outline-focus: color.change(
867-
var(--background-color),
868-
$blue: 100,
869-
$alpha: 1
870-
);
886+
--pf-outline-focus: var(--link-color);
871887
--pf-input-height: 100%;
872888
--pf-searchbox-max-width: 100%;
889+
--pf-font: "Open Sans", sans-serif;
873890
height: 100% !important;
874891
width: 100%;
875892

@@ -891,24 +908,25 @@ div#back-to-top {
891908
}
892909

893910
div.pagefind-container {
894-
--pf-skeleton: rgba(0, 0, 0, 0);
895-
--pf-border-radius: #{var(--border-radius)};
911+
--pf-skeleton: var(--background-color);
912+
--pf-border-radius: var(--border-radius);
913+
--pf-modal-backdrop: var(--background-color);
914+
--pf-background: var(--background-color);
915+
--pf-text: var(--text-color);
896916
padding: var(--padding);
897917
position: fixed;
898918
z-index: 2;
899919
height: auto;
920+
max-width: 768px;
900921
max-height: 70vh;
901922
top: 6rem;
902923
left: 50%;
903924
transform: translateX(-50%);
904-
width: 80vw;
905-
max-width: 768px;
906925
overflow: auto;
907926
pointer-events: none;
908927
@include scrollbars();
909928

910929
&.active {
911-
background-color: var(--background-color);
912930
backdrop-filter: var(--backdrop-filter);
913931
pointer-events: all;
914932
border-radius: var(--border-radius);
@@ -1017,9 +1035,8 @@ div#back-to-top {
10171035
--padding: 15px;
10181036
--link-color: #89b4fa;
10191037
--link-hover-color: #74c7ec;
1020-
--border-radius: 15px;
1021-
--border: none;
10221038
--backdrop-filter: none;
1039+
--logo: url("/global/OSPedia-logo-dark.svg");
10231040
}
10241041
}
10251042

@@ -1085,7 +1102,7 @@ div#back-to-top {
10851102
border-radius: var(--border-radius) var(--border-radius) 0 0;
10861103
}
10871104

1088-
div.home-os-cards > div.bottom {
1105+
div.home-os-cards>div.bottom {
10891106
height: 20rem;
10901107
margin: 1vh 1vw;
10911108
padding: 1vh 2vw;
@@ -1113,11 +1130,12 @@ div#back-to-top {
11131130
justify-content: center;
11141131
align-items: center;
11151132

1116-
img {
1133+
div.ospedia-logo {
11171134
width: 90%;
11181135
align-self: center;
1119-
max-height: 40%;
1120-
left: 50%;
1136+
height: 8rem;
1137+
background-position: center;
1138+
background-size: auto 100%;
11211139
}
11221140
}
11231141

assets/global/stylesheets/base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/global/stylesheets/base.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/global/stylesheets/demos.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/global/stylesheets/index-page.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/global/stylesheets/index-page.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)