hugo-theme-mofo

Minimal theme for Hugo
git clone https://git.bracken.jp/hugo-theme-mofo.git
Log | Files | Refs | LICENSE

commit e75c20136d7d9e5de8aeac9a2088b16104931992
parent b834a391481478d53d3f2031ddbb021fed44c566
Author: Chris Bracken <chris@bracken.jp>
Date:   Tue, 31 Aug 2021 09:08:51 -0700

Reduce CSS from 1780 to 1636 bytes (8.2%)

No functional changes to the CSS, but shaves some low-hanging fruit off
the file size:
* Reduce a verbose comment
* Eliminate spaces between `foo > bar` selectors
* Change nav item padding from 'top left bottom right' form to 'vertical
  horizontal' form.
* Replace space-based indentation with tab-based indentation

Saves 146 bytes, or just under one SMS text message per transfer.

Diffstat:
Mstatic/css/site.css | 96+++++++++++++++++++++++++++++++++++++++----------------------------------------
1 file changed, 47 insertions(+), 49 deletions(-)

diff --git a/static/css/site.css b/static/css/site.css @@ -1,79 +1,77 @@ -/* Light/Dark mode support */ +/* Light/Dark mode */ :root { - color-scheme: light dark; - --border-color: #ccc; - --pre-background-color: #f5f5f5; - --text-color: #333; - --link-color: #0044dd; + color-scheme: light dark; + --border-color: #ccc; + --pre-background-color: #f5f5f5; + --text-color: #333; + --link-color: #0044dd; } @media (prefers-color-scheme: dark) { - :root { - --border-color: #333; - --pre-background-color: #1a1a1a; - --text-color: #ccc; - --link-color: #3377dd; - background-color:#121212; - } + :root { + --border-color: #333; + --pre-background-color: #1a1a1a; + --text-color: #ccc; + --link-color: #3377dd; + background-color:#121212; + } } /* Basics */ body { - color: var(--text-color); - font-size: 16px; - line-height: 1.6; - margin: 40px auto; - max-width: 650px; - padding: 0 10px + color: var(--text-color); + font-size: 16px; + line-height: 1.6; + margin: 40px auto; + max-width: 650px; + padding: 0 10px +} +a { + color: var(--link-color); + text-decoration: none; } pre { - background-color: var(--pre-background-color); - border: 1px solid var(--border-color); - border-radius: 2px; - font-size: 12px; - line-height: 1.1; - overflow-x: auto; - padding: 10px; + background-color: var(--pre-background-color); + border: 1px solid var(--border-color); + border-radius: 2px; + font-size: 12px; + line-height: 1.1; + overflow-x: auto; + padding: 10px; } code { font-size: 14px; line-height: 1.2; } -pre > code { font-size: 12px; } -a { - color: var(--link-color); - text-decoration: none; -} +pre>code { font-size: 12px; } h1,h2,h3 { line-height: 1.2; } -h1 > a { color: var(--text-color); } -h2 > a { color: var(--text-color); } -h3 > a { color: var(--text-color); } +h1>a,h2>a,h3>a { color: var(--text-color); } .center { text-align: center; } /* Header */ header { margin-bottom: 2.5em; } -header > div.site-title > h1 { - margin: 0; - text-align: center; +header>div.site-title>h1 { + margin: 0; + text-align: center; } /* Navbar */ -nav > .menu { - list-style-type: none; - margin: 0; - padding: 0; - text-align: center; +nav>.menu { + list-style-type: none; + margin: 0; + padding: 0; + text-align: center; } -nav > ul > li.menu-item { - display: inline; - padding: 0 0.5em 0 0.5em; +nav>ul>li.menu-item { + display: inline; + padding: 0 0.5em; } -nav > ul > li.menu-item > a { color: var(--text-color); } +nav>ul>li.menu-item>a { color: var(--text-color); } /* Footer */ -footer > div.copyright { display: none; text-align: center; } +footer>div.copyright { display: none; text-align: center; } /* Home */ -section#posts > ol.post-list { list-style-type: none; } +section#posts>ol.post-list { list-style-type: none; } /* Single */ article h2.post-title { margin-bottom: 0.15em; } article img { display: block; margin-left: auto; margin-right: auto; max-width: 100%; } article figcaption { text-align: center; } -article figcaption > h4 { font-weight: normal; margin-top: 0; } +article figcaption>h4 { font-weight: normal; margin-top: 0; }