From: Svante Bengtson Date: Fri, 26 Feb 2016 14:34:32 +0000 (+0100) Subject: refactor CSS to use vars for all colours X-Git-Url: https://jfr.im/git/irc/freenode/web-7.0.git/commitdiff_plain/refs/pull/69/head?ds=sidebyside refactor CSS to use vars for all colours --- diff --git a/static/css/style.css b/static/css/style.css index 7a37d7869..dd2ca74c5 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1,21 +1,39 @@ /* vars */ :root { - --navbar-bg: #292f2f; + /* backgrounds */ + --navbar-bg: #292f2f; --jumbotron-bg: #3a4346; --copyright-bg: #292f2f; - --link-color: #2fa6bc; + + /* link colors */ + --link-color: #2fa6bc; --footer-link-color: #ecf7fa; - --nlink-col: #000; - --text-color: #292f2f; - --footer-text-color: #ecf7fa; + --nlink-col: #000000; + + /* text colors */ + --text-color: #292f2f; + --footer-text-color: #ecf7fa; --copyright-text-color: #ecf7fa; --jumbotron-text-color: #ecf7fa; - --border-color: #292f2f; - --box-color: #4c5456; + --fn-grey: #e6e6e6; + --fn-green: #4beb4a; + --art-date-color: #bdbcbc; + --footer-hover-color: #ffffff; + + /* box colors */ + --border-color: #292f2f; + --box-color: #4c5456; --box-hover-color: #292f2f; - --box-round: 10px; - --max-width: 600px; + --box-round: 10px; + + /* other */ + --max-width: 600px; + --max-width-box: 800px; + --margin-box-fa: 5px; } +@custom-media --max-sm all and (max-width: 600px); +@custom-media --max-md all and (max-width: 800px); +@custom-media --max-rem all and (max-width: 60rem); /* reset css for browser compat */ * { @@ -62,14 +80,14 @@ a { margin-top: auto; margin-bottom: auto; font-size: 30px; - color: #E6E6E6; + color: var(--fn-grey); text-shadow: .5px .5px #000; } .green { - color: #4BEB4A; + color: var(--fn-green); } -@media all and (max-width: 600px) { +@media (--max-sm); { .navbar { position: absolute; } @@ -162,7 +180,7 @@ hr { flex-wrap: wrap; justify-content: space-around; align-items: stretch; - max-width: 800px; + max-width: var(--max-width-box); margin: 0 auto; } @@ -193,17 +211,58 @@ hr { } .fa-users { - margin-top: 5px; + margin-top: var(--margin-box-fa); } .fa-comment,.fa-question { - margin-bottom: 5px; + margin-bottom: var(--margin-box-fa); } .title { text-align: center; } +@media (--max-md) { + .box { + text-align: center; + } + + .child { + font-size: 20px; + line-height: 30px; + padding: 10px 0 5px; + } + + .fa-4x { + padding: 0; + margin: 0; + width: 60px; + text-align: center; + font-size: 28px; + } + + .box-container { + flex-direction: column; + margin: 0 .5em; + } + + .box div { + font-size: 22px; + line-height: 22px; + padding-left: 8px; + font-weight: 700; + position: relative; + display: inline; + text-align: center; + } + + .box { + text-align: left; + border-radius: calc(var(--box-round) / 2); + margin: 5px 0; + } +} + /* articles */ h1 { margin: 0; @@ -242,7 +301,7 @@ h1 { text-align: baseline; line-height: 1; white-space: nowrap; - color: #bdbcbc; + color: var(--art-date-color); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; } @@ -254,7 +313,7 @@ h1 { width: 100%; } -@media all and (max-width: 600px) { +@media (--max-md) { .main.artlist { padding-left: 0; padding-right: 0; @@ -265,49 +324,6 @@ h1 { } } -/* help */ -.hmain { - display: flex; - flex-wrap: wrap; - justify-content: space-around; - align-items: stretch; -} - -a.hchild { - color: var(--text-color); -/*height: 40px;*/ - width: 95%; - text-align: center; - border-top: 1px solid var(--border-color); - border-left: 1px solid var(--border-color); - border-right: 1px solid var(--border-color); -} - -a.hchild:hover,a.hchild:active { - background-color: var(--box-hover-color); -} - -.hchild:first-child { - margin-top: 10px; - -webkit-border-top-left-radius: var(--box-round); - -webkit-border-top-right-radius: var(--box-round); - -moz-border-radius-topleft: var(--box-round); - -moz-border-radius-topright: var(--box-round); - border-top-left-radius: var(--box-round); - border-top-right-radius: var(--box-round); -} - -.hchild:last-child { - margin-bottom: 10px; - border-bottom: 1px solid var(--border-color); - -webkit-border-bottom-right-radius: var(--box-round); - -webkit-border-bottom-left-radius: var(--box-round); - -moz-border-radius-bottomright: var(--box-round); - -moz-border-radius-bottomleft: var(--box-round); - border-bottom-right-radius: var(--box-round); - border-bottom-left-radius: var(--box-round); -} - /* faq */ .faq-index { list-style-type: none; @@ -351,7 +367,7 @@ a.hchild:hover,a.hchild:active { margin-bottom: 1em; } -@media all and (max-width: 60rem) { +@media (--max-rem) { .footer-push { margin-left: auto; width: max-content; @@ -363,7 +379,7 @@ footer a { } footer a:hover { - color: #fff; + color: var(--footer-hover-color); } .footer h2 { @@ -382,7 +398,7 @@ footer a:hover { padding-left: 30px; } -@media all and (max-width: 600px) { +@media (--max-md) { .footer { flex-direction: column; } @@ -402,46 +418,6 @@ footer a:hover { .hdn { display: none; } - - .box { - text-align: center; - } - - .child { - font-size: 20px; - line-height: 30px; - padding: 10px 0 5px; - } - - .fa-4x { - padding: 0; - margin: 0; - width: 60px; - text-align: center; - font-size: 28px; - } - - .box-container { - flex-direction: column; - margin: 0 .5em; - } - - .box div { - font-size: 22px; - line-height: 22px; - padding-left: 8px; - font-weight: 700; - position: relative; - display: inline; - text-align: center; - - } - - .box { - text-align: left; - border-radius: calc(var(--box-round) / 2); - margin: 5px 0; - } } .footer h2, .footer h3 {