Skip to content

Commit a08cbed

Browse files
committed
Replace navbar bottom border with softer shadow
1 parent 8983465 commit a08cbed

File tree

5 files changed

+31
-36
lines changed

5 files changed

+31
-36
lines changed

website/src/styles/constants.scss

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ $navtab-height: 3rem;
77
$side-nav-width-md: 4rem;
88
$side-nav-width-lg: 10rem;
99

10-
$navtab-shadow-height: 0.8rem;
11-
$navtab-shadow-color: rgba(#000, 0.1);
12-
$navtab-shadow-color-night: rgba(#000, 0.7);
10+
$navbar-shadow-height: 0.2rem;
1311

1412
// Type
1513
$sm-font-size-ratio: 0.875;
@@ -53,7 +51,7 @@ $nusmods-theme-colors: (
5351
#95aec7,
5452
#ae95c7,
5553
#c795ae,
56-
#c79595
54+
#c79595,
5755
),
5856
chalk: (
5957
#fb9fb1,
@@ -63,7 +61,7 @@ $nusmods-theme-colors: (
6361
#12cfc0,
6462
#6fc2ef,
6563
#e1a3ee,
66-
#deaf8f
64+
#deaf8f,
6765
),
6866
eighties: (
6967
#f2777a,
@@ -73,7 +71,7 @@ $nusmods-theme-colors: (
7371
#6cc,
7472
#69c,
7573
#c9c,
76-
#d27b53
74+
#d27b53,
7775
),
7876
google: (
7977
#cc342b,
@@ -83,7 +81,7 @@ $nusmods-theme-colors: (
8381
#3971ed,
8482
#79a4f9,
8583
#a36ac7,
86-
#ec9998
84+
#ec9998,
8785
),
8886
mocha: (
8987
#cb6077,
@@ -93,7 +91,7 @@ $nusmods-theme-colors: (
9391
#7bbda4,
9492
#8ab3b5,
9593
#a89bb9,
96-
#bb9584
94+
#bb9584,
9795
),
9896
monokai: (
9997
#f92672,
@@ -103,7 +101,7 @@ $nusmods-theme-colors: (
103101
#a1efe4,
104102
#66d9ef,
105103
#ae81ff,
106-
#c63
104+
#c63,
107105
),
108106
ocean: (
109107
#bf616a,
@@ -113,7 +111,7 @@ $nusmods-theme-colors: (
113111
#96b5b4,
114112
#8fa1b3,
115113
#b48ead,
116-
#ab7967
114+
#ab7967,
117115
),
118116
oceanic-next: (
119117
#ec5f67,
@@ -123,7 +121,7 @@ $nusmods-theme-colors: (
123121
#5fb3b3,
124122
#69c,
125123
#c594c5,
126-
#ab7967
124+
#ab7967,
127125
),
128126
paraiso: (
129127
#ef6155,
@@ -133,7 +131,7 @@ $nusmods-theme-colors: (
133131
#5bc4bf,
134132
#06b6ef,
135133
#815ba4,
136-
#e96ba8
134+
#e96ba8,
137135
),
138136
railscasts: (
139137
#da4939,
@@ -143,7 +141,7 @@ $nusmods-theme-colors: (
143141
#519f50,
144142
#6d9cbe,
145143
#b6b3eb,
146-
#bc9458
144+
#bc9458,
147145
),
148146
tomorrow: (
149147
#c66,
@@ -153,7 +151,7 @@ $nusmods-theme-colors: (
153151
#8abeb7,
154152
#81a2be,
155153
#b294bb,
156-
#a3685a
154+
#a3685a,
157155
),
158156
twilight: (
159157
#cf6a4c,
@@ -163,7 +161,7 @@ $nusmods-theme-colors: (
163161
#afc4db,
164162
#7587a6,
165163
#9b859d,
166-
#9b703f
164+
#9b703f,
167165
),
168166
);
169167

website/src/styles/utils/css-variables.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
--body-bg-transparent: #{rgba($body-bg, 0)};
2121

2222
// Shadows
23-
--navtab-shadow: #{rgba(#000, 0.1)};
23+
--navbar-shadow: #{rgba(#000, 0.09)};
2424

2525
// Body font color
2626
--body-color: #{$body-color};
@@ -51,7 +51,7 @@ body.mode-dark {
5151
--body-bg-transparent: #{rgba($gray-dark, 0)};
5252

5353
// Shadows
54-
--navtab-shadow: #{rgba(#000, 0.26)};
54+
--navbar-shadow: #{rgba(#000, 0.5)};
5555

5656
// Body font color
5757
--body-color: #aaa;

website/src/views/components/SearchkitSearchBox.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
@include media-breakpoint-down(sm) {
1515
z-index: $module-finder-search-z-index-sm;
16-
padding: 0 0 $navtab-shadow-height;
16+
padding: 0 0 $navbar-shadow-height;
1717
margin: -1rem (-$grid-gutter-width / 2) 0;
1818
border-top: 1px solid var(--gray-lighter);
1919
background: linear-gradient(
2020
to bottom,
21-
var(--body-bg) calc(100% - #{$navtab-shadow-height}),
22-
var(--navtab-shadow) calc(100% - #{$navtab-shadow-height}),
21+
var(--body-bg) calc(100% - #{$navbar-shadow-height}),
22+
var(--navbar-shadow) calc(100% - #{$navbar-shadow-height}),
2323
rgba(#000, 0)
2424
);
2525
}

website/src/views/components/SideMenu.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ $offset-top: $navbar-height + 1rem;
6767
transform: translateY($closed-menu-translation);
6868
transition: transform $animation-duration, box-shadow $animation-duration;
6969
&.isOpen {
70-
box-shadow: 0 -10px 20px var(--navtab-shadow);
70+
box-shadow: 0 -10px 20px var(--navbar-shadow);
7171
transform: translateY(0);
7272
}
7373
}

website/src/views/layout/Navbar.scss

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@ $logo-vert-padding: 0.875rem;
1111
z-index: $navbar-z-index;
1212
padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
1313
background: var(--body-bg);
14-
border-bottom: 1px solid var(--gray-lighter);
1514
display: flex;
1615
flex-flow: column;
1716
align-items: center;
17+
18+
// Fake shadow - don't use box shadow as the sides will be lighter
19+
&::after {
20+
content: '';
21+
position: absolute;
22+
right: 0;
23+
bottom: -$navbar-shadow-height;
24+
left: 0;
25+
height: $navbar-shadow-height;
26+
background: linear-gradient(to bottom, var(--navbar-shadow), rgba(#000, 0));
27+
pointer-events: none;
28+
}
1829
}
1930

2031
.topBar {
@@ -78,20 +89,6 @@ $logo-vert-padding: 0.875rem;
7889
.navbarWrapper {
7990
top: -$navbar-height;
8091
border-bottom-width: 0;
81-
82-
// Fake shadow - can't use box shadow because they will appear on top of the
83-
// top nav bar
84-
// TODO: See if box shadow works now because this shadow is now on the nav bar itself
85-
&::after {
86-
content: '';
87-
position: absolute;
88-
right: 0;
89-
bottom: -$navtab-shadow-height; // TODO: Rename these vars
90-
left: 0;
91-
height: $navtab-shadow-height;
92-
background: linear-gradient(to bottom, var(--navtab-shadow), rgba(#000, 0));
93-
pointer-events: none;
94-
}
9592
}
9693

9794
.bottomBar {

0 commit comments

Comments
 (0)