|
| 1 | +/* IMPORTS. */ |
| 2 | + |
| 3 | +/* |
| 4 | +IMPORTS - FONTS. |
| 5 | +*/ |
| 6 | + |
| 7 | +/* |
| 8 | +Google Fonts: |
| 9 | +- 'Krona One': |
| 10 | + - URL: 'https://fonts.google.com/specimen/Krona+One'. |
| 11 | + - Specs: Weight: regular 400. |
| 12 | +- 'Montserrat': |
| 13 | + - URL: 'https://fonts.google.com/specimen/Montserrat'. |
| 14 | + - Specs: Weight: regular 400. Italic: Roman-only (no italic included). |
| 15 | +*/ |
| 16 | +@import url('https://fonts.googleapis.com/css2?family=Krona+One&family=Montserrat&display=swap'); |
| 17 | + |
| 18 | +/* |
| 19 | +VARIABLES DECLARATION. |
| 20 | +- variable's name MUST BEGIN with 2 dashes (--), and it's CASE SENSITIVE. |
| 21 | +- Scopes: |
| 22 | + - Global scope: declare within ':root' selector. |
| 23 | + - Local scope: declare variable within specific selector, not in ':root'. |
| 24 | +- Ref.: 'https://www.w3schools.com/css/css3_variables.asp'. |
| 25 | +*/ |
| 26 | +:root { |
| 27 | + --font_size_default: 16px; /* Default web-browsers font-size: 'https://stackoverflow.com/questions/29511983/is-the-default-font-size-of-every-browser-16px-why/29512572#29512572'. */ |
| 28 | + --colors_background: #0D1117; |
| 29 | + --colors_01: #F0AB3C; |
| 30 | + --colors_02: #F6F6F6; |
| 31 | + --colors_03: #000000; |
| 32 | + --fonts_fallback: system-ui, sans-serif; /* Hierarchical list of fonts; from preferred, to fallback: 'https://www.w3schools.com/cssref/pr_font_font-family.php', 'https://developer.mozilla.org/en-US/docs/Web/CSS/font-family', 'https://www.w3schools.com/css/css_font_websafe.asp'. */ |
| 33 | + --line_height_default: 1.5; |
| 34 | + --fonts_main: "Montserrat", var(--fonts_fallback); |
| 35 | + --fonts_minor: "Krona One", var(--fonts_fallback); |
| 36 | +} |
| 37 | + |
| 38 | +/* Universal changes for all tags / elements / classes */ |
| 39 | +* { |
| 40 | + /* Set proper dimensions for full page size: 'https://www.freecodecamp.org/news/html-page-width-height/'. */ |
| 41 | + padding: 0; |
| 42 | + margin: 0; |
| 43 | + box-sizing: border-box; /* Set appropiate box-sizing: 'https://www.w3schools.com/css/css3_box-sizing.asp'. */ |
| 44 | +} |
| 45 | + |
| 46 | +/* DEFAULT HTML TAGS. */ |
| 47 | + |
| 48 | +html { |
| 49 | + font-size: var(--font_size_default); /* Recommended, explicit declaration: 'https://stackoverflow.com/questions/29511983/is-the-default-font-size-of-every-browser-16px-why/29512572#29512572'. */ |
| 50 | + font-family: var(--fonts_main); |
| 51 | + line-height: var(--line_height_default); |
| 52 | +} |
| 53 | + |
| 54 | +body { |
| 55 | + background-color: var(--colors_background); |
| 56 | + color: var(--colors_02); |
| 57 | +} |
| 58 | + |
| 59 | +ul { |
| 60 | + padding: 10px 0px 0px 20px !important; /* IMPORTANT: lists REQUIRE PADDING; therefore, need manual adjustment, if padding set GLOBALLY to 0; i.e. '* { padding: 0; }'. Ref.: 'https://stackoverflow.com/questions/72279264/unordered-list-not-showing-bullets/72281511#72281511', 'https://www.w3schools.com/css/css_important.asp'.*/ |
| 61 | +} |
| 62 | + |
| 63 | +/* Use of 'media queries' to define layouts according to specific screen resolutions: 'https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries#targeting_media_features'. */ |
| 64 | +@media (width > 0px) { /* Base design, as starting point: e.g. for desktop, although recommended to start with mobile, 1st: 'https://stackoverflow.com/questions/6370690/media-queries-how-to-target-desktop-tablet-and-mobile/20350990#20350990'. */ |
| 65 | + |
| 66 | + /* CUSTOM CLASSES. */ |
| 67 | + |
| 68 | + .header { |
| 69 | + /* Create a sticky header: 'https://www.w3schools.com/howto/howto_js_sticky_header.asp'. */ |
| 70 | + position: sticky; |
| 71 | + top: 0; |
| 72 | + |
| 73 | + background-color: var(--colors_03); |
| 74 | + padding: 10px; /* Padding: [top], [right], [bottom], [left]. Ref.: 'https://www.w3schools.com/css/css_padding.asp' */ |
| 75 | + } |
| 76 | + |
| 77 | + .header-nav { |
| 78 | + display: flex; /* Display as flexbox: 'https://css-tricks.com/snippets/css/a-guide-to-flexbox/#aa-display'. */ |
| 79 | + gap: 15px; /* Separates flexbox items: logo-pages block, from navigation tools. Ref.: 'https://css-tricks.com/snippets/css/a-guide-to-flexbox/#aa-gap-row-gap-column-gap'.*/ |
| 80 | + justify-content: space-between; /* Sends left (and right; only 2) flex-items to opposites. Ref.: 'https://css-tricks.com/snippets/css/a-guide-to-flexbox/#aa-justify-content'.*/ |
| 81 | + align-items: center; /* Aligns vertically, to center the logo-pages block, with navigation tools. */ |
| 82 | + } |
| 83 | + |
| 84 | + .header-nav-left_aligned { |
| 85 | + display: flex; |
| 86 | + gap: 15px; /* Separates pages block from logo. */ |
| 87 | + } |
| 88 | + |
| 89 | + .header-nav-left_aligned-logo { |
| 90 | + height: 30px; /* Set proper height for logo. */ |
| 91 | + } |
| 92 | + |
| 93 | + .header-nav-left_aligned-links_container { |
| 94 | + display: flex; |
| 95 | + gap: 25px; /* Separate each page. */ |
| 96 | + align-items: center; /* Matches vertical allignment of previous allignment of logo-pages block, with navigation tools. */ |
| 97 | + } |
| 98 | + |
| 99 | + .header-nav-left_aligned-links_container-link { |
| 100 | + color: var(--colors_01); |
| 101 | + text-decoration-line: none; /* To eliminate underscore format of hyperlinks. */ |
| 102 | + font-size: 1.3em; |
| 103 | + } |
| 104 | + |
| 105 | + .header-nav-links_container { |
| 106 | + display: flex; |
| 107 | + flex-direction: column; |
| 108 | + font-size: 0.8em; |
| 109 | + } |
| 110 | + |
| 111 | + .header-nav-links_container-link { |
| 112 | + text-decoration-line: none; |
| 113 | + } |
| 114 | + |
| 115 | + .main-pyscript { |
| 116 | + margin: 0.5rem; |
| 117 | + } |
| 118 | + |
| 119 | +} |
0 commit comments