Skip to content

Commit 7ac3c82

Browse files
committed
Clean up CSS
1 parent 10ab30b commit 7ac3c82

File tree

1 file changed

+45
-111
lines changed

1 file changed

+45
-111
lines changed

assets/css/main.scss

Lines changed: 45 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ h3 {
8888
/* Create & style a 3x3 grid wrapper */
8989
.grid {
9090
display: grid;
91-
gap: 1px;
92-
grid-template-columns: repeat(3, 1fr);
91+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
92+
grid-gap: .3rem;
9393

9494
h4.grid_title {
9595
font-size: 1.4em;
@@ -199,23 +199,12 @@ nav bar: POSITION:relative to ensure it stays at the top */
199199
max-width: 25%;
200200
}
201201

202-
.nav__links.vertical .dropdown .dropdown-content {
203-
position: relative!important;
204-
width: 100%;
205-
}
206-
/* button also needs to be 100% */
207-
.nav__links.vertical .dropbtn {
208-
width: 100%;
209-
text-align: left;
210-
}
211202

212-
/* drop down should be the entire width of the ul block not just the
213-
parent text width */
214-
.nav__links.vertical .dropdown-content {
215-
min-width: 100%;
216-
}
203+
/* Upon click the menu should turn into a vertical stacked menu with a soft
204+
drop shadow
217205
218-
// Upon click the menu should turn into a vertical stacked menu with a soft drop shadow
206+
TODO check for redundant styles
207+
*/
219208
.nav__links.vertical {
220209
position: absolute;
221210
display: flex;
@@ -230,13 +219,42 @@ parent text width */
230219
z-index: 1;
231220
border: 1px solid #f2f3f3;
232221
border-radius: 4px;
233-
background: #fff;
234222
-webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
235223
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
236-
}
237224

238-
.nav__links.vertical li {
239-
width: 100%;
225+
li {
226+
width: 100%;
227+
}
228+
229+
.dropdown-content {
230+
min-width: 100%;
231+
}
232+
.dropbtn {
233+
width: 100%;
234+
text-align: left;
235+
}
236+
237+
a {
238+
float: none;
239+
display: block;
240+
text-align: left;
241+
}
242+
.dropdown {
243+
float: none;
244+
}
245+
246+
.dropdown-content {position: relative;}
247+
248+
.dropdown .dropbtn {
249+
display: block;
250+
width: 100%;
251+
text-align: left;
252+
}
253+
254+
.dropdown .dropdown-content {
255+
position: relative!important;
256+
width: 100%;
257+
}
240258
}
241259
/* End nav links bar styles */
242260

@@ -279,7 +297,6 @@ parent text width */
279297

280298
/* Begin burger styling: actual hamburger element (the horiz lines)*/
281299
.burger__icon {
282-
/* //opacity: 0; */
283300
position: relative;
284301
width: 1.5rem;
285302
height: .25rem;
@@ -337,8 +354,6 @@ parent text width */
337354
width: 1.5rem;
338355
}
339356

340-
/* End burger styling */
341-
342357
.visually-hidden {
343358
position: absolute !important;
344359
clip: rect(1px, 1px, 1px, 1px);
@@ -347,9 +362,7 @@ parent text width */
347362
border: 0 !important;
348363
overflow: hidden;
349364
}
350-
351-
/* end ham */
352-
365+
/* end burger */
353366

354367
/* Dropdown container for nav links */
355368
.dropdown {
@@ -367,12 +380,9 @@ parent text width */
367380
}
368381
}
369382

370-
371383
/* Style the dropdown content (hidden by default) */
372384
.dropdown-content {
373385
display: none;
374-
// opacity: 0; /* here */
375-
// position: absolute;
376386
background-color: #fff;
377387
min-width: 160px;
378388
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
@@ -397,15 +407,8 @@ parent text width */
397407
color: $nav-hover-color;
398408
}
399409

400-
/* Show the dropdown menu when the user hovers over the dropdown
401-
button. What's most accessible, click only or click and hover both?
402-
Right now hover is removed
403-
*/
404-
/* .dropdown:hover .dropdown-content, */
405410
.dropdown .dropdown-content.open {
406411
display: block;
407-
/* transform: translateY(0);
408-
opacity: 1; */
409412
}
410413
/* This style may be removed ultimately - it is the fancy underline */
411414

@@ -414,7 +417,7 @@ Right now hover is removed
414417
position: relative;
415418
color: #0087ca;
416419
}
417-
/* Make sure the line is 100% of text */
420+
418421
.hover-underline {
419422
width: 100%;
420423
text-align: left !important;
@@ -441,38 +444,15 @@ Right now hover is removed
441444
transform: scaleX(1); // reveal
442445
}
443446

444-
445447
/* Add an active class to highlight the current page - might want to reinstate this */
446448
.active {
447449
background-color: #04AA6D;
448450
color: white;
449451
}
450452

451-
452-
453-
/* When the screen is less than 600 pixels wide, hide all links, except for the
454-
first one ("Home"). Show the link that contains should open and close the nav__links (.icon) */
455-
456-
457-
@media screen and (max-width: 600px) {
458-
459-
.grid {
460-
display: grid;
461-
gap: 1px;
462-
grid-template-columns: repeat(1, 1fr);
463-
}
464-
}
465-
466-
467453
/* 768 px */
468454
@media screen and (max-width: 768px) {
469455

470-
.grid {
471-
display: grid;
472-
gap: 1px;
473-
grid-template-columns: repeat(2, 1fr);
474-
}
475-
476456
.hamburger__btn-toggle {
477457
//position: fixed; // not sure if this will help?
478458
display: block;
@@ -481,62 +461,21 @@ first one ("Home"). Show the link that contains should open and close the nav__l
481461
right: 5%;}
482462

483463
burger__icon, burger__icon::before, burger__icon::after {
484-
display: block;
485-
486-
}
464+
display: block; }
487465

488466
/* Hide horizontal drop down links at 48em / 768px */
489-
.nav__links {
490-
display: none;
491-
}
492-
.nav__links {
493-
a:not(:first-child), li, .dropdown .dropbtn {
494-
495-
}
496-
497-
a.icon {
498-
float: right;
499-
display: block;
500-
font-size: 2em;
501-
padding-right: 1em;
502-
padding-top: 0;
503-
}
504-
}
467+
.nav__links { display: none;}
505468

506469
/* Nav links goes vertical in responsive mode */
507470
.nav__links .vertical {
508471
position: absolute;
509472
display: flex;
510473
flex-direction: column;
511474
align-items: flex-start;
512-
padding-top: 2em;
475+
/* padding-top: 2em;
513476
top: 50%;
514477
left: 70%;
515-
background-color: #fff;
516-
517-
a.icon {
518-
font-size: 2em;
519-
position: absolute;
520-
right: 0;
521-
top: 0;
522-
padding-right: 1em;
523-
}
524-
a {
525-
float: none;
526-
display: block;
527-
text-align: left;
528-
}
529-
.dropdown {
530-
float: none;
531-
}
532-
533-
.dropdown-content {position: relative;}
534-
535-
.dropdown .dropbtn {
536-
display: block;
537-
width: 100%;
538-
text-align: left;
539-
}
478+
background-color: #fff; */
540479
}
541480
/* position search toggle by burger */
542481
.search__toggle {
@@ -547,7 +486,6 @@ first one ("Home"). Show the link that contains should open and close the nav__l
547486
}
548487
}
549488

550-
551489
/* End media query 48em / 768 px */
552490

553491
/* package cards splash */
@@ -563,10 +501,6 @@ first one ("Home"). Show the link that contains should open and close the nav__l
563501
font-size: 1.2em;
564502
}
565503

566-
// h3 {
567-
// font-size: 1.3em;
568-
// }
569-
570504
h3.card__title.no_toc {
571505
margin-top: .3em;
572506
font-size: 1.5em;

0 commit comments

Comments
 (0)