Commit 6b1694ae authored by Scott Zeid's avatar Scott Zeid

Make normal-weight Ubuntu font more pleasant on HiDPI (lighter and 0.4pt smaller)

parent 815f14a2
......@@ -14,7 +14,7 @@ if $monospace
@import url("https://fonts.s.zeid.me/latin-modern/mono.css");
$google-web-font-css = "https://fonts.googleapis.com/css?family="
@import url($google-web-font-css+"Ubuntu:normal,bold,italic,bolditalic");
@import url($google-web-font-css+"Ubuntu:light,lightitalic,regular,italic,medium,mediumitalic,bold,bolditalic");
@import url($google-web-font-css+"Ubuntu+Mono:normal,bold,italic,bolditalic");
@import url($google-web-font-css+"Material+Icons");
......@@ -35,16 +35,17 @@ body
line-height: 1.25em;
background: $background-plain;
color: $text;
@media print //
@media print //{}
background: #FFF;
color: #000;
html, body, input, select, textarea
html, body, button, input, select, textarea
font-family: "Ubuntu", "Droid Sans", "Trebuchet MS", "DejaVu Sans",
"Bitstream Vera Sans", "Verdana", sans-serif;
font-size: 12pt;
// HiDPI font stuff is in basic and site, not here
html.monospace-style
&, body, input, select, textarea
&, body, button, input, select, textarea
font-family: "Latin Modern Mono", "Droid Sans Mono", "DejaVu Sans Mono",
"Consolas", "Courier New", "Courier", monospace;
font-size: 10pt;
......@@ -105,11 +106,11 @@ hn(n, size)
font-size: roundn(size, 2);
margin: roundn(1 / size, 2) 0 roundn((1 / size) * 0.5, 2) 0;
line-height: 1.25em;
font-weight: normal;
font-weight: normal true; // true means apply HiDPI regardless of $monospace
text-transform: uppercase;
letter-spacing: roundn((1 / size) * 0.5, 2);;
&.plain
font-weight: bold;
font-weight: bold true; // true means apply HiDPI regardless of $monospace
text-transform: none;
letter-spacing: normal;
......
......@@ -7,6 +7,16 @@
/* basic.css rules */
html:not(.monospace-style)
&, body, button, input, select, textarea
// lighter fonts for HiDPI are applied in helpers.styl:font-weight()
// (true gets passed to hidpi() so that it applies even when $monospace == true)
font-weight: normal true;
b, strong, th
font-weight: bold true;
+hidpi(true)
font-size: 11.6pt;
body
max-width: 720px;
margin: 1em auto;
......
roundn(num, precision)
return (round(num * (10 ** precision)) / (10 ** precision));
// HiDPI stuffs
hidpi(cond=null)
if cond == null
cond = !$monospace
if cond
&
@media (min-resolution: 97dpi) //{}
{block}
font-weight(value, cond=null)
font-weight: value;
+hidpi(cond)
if value == normal
font-weight: lighter;
else if value == bold
font-weight: bold; //500;
// Vendor prefix shit
display(how)
......
......@@ -75,6 +75,8 @@ body > header
background: $header-dropdown-background;
color: $header-dropdown-text;
text-shadow: 1px 1px $header-dropdown-text-shadow;
+hidpi()
text-shadow: 0.75px 0.75px $header-dropdown-text-shadow;
transition: all 0.4s ease-out;
&:hover, &:focus
text-decoration: none;
......@@ -119,6 +121,8 @@ body > header
background: $header-highlight;
color: $header-highlight-text;
text-shadow: 1px 1px $header-highlight-text-shadow;
+hidpi()
text-shadow: 0.75px 0.75px $header-highlight-text-shadow;
& > a:hover, & > a:focus
background: $header-highlight-darker;
&.current > a, &.home > a
......@@ -168,6 +172,8 @@ body > header
background: transparent;
color: $header-text;
text-shadow: 1px 1px $header-text-shadow;
+hidpi()
text-shadow: 0.75px 0.75px $header-text-shadow;
img
margin-right: -0.25em;
if $menu-shadows
......
......@@ -7,7 +7,7 @@
@require "base"
if $monospace
html, body, input, select, textarea
html, body, button, input, select, textarea
font-family: "Latin Modern Mono", "Droid Sans Mono", "DejaVu Sans Mono",
"Consolas", "Courier New", "Courier", monospace;
font-size: 10pt;
......@@ -26,6 +26,14 @@ if $monospace
top: 0;
input[type="text"], input[type="password"], select, textarea
font-size: 10pt;
else
html, body, button, input, select, textarea
// lighter fonts for HiDPI are applied in helpers.styl:font-weight()
font-weight: normal;
b, strong, th
font-weight: bold;
+hidpi()
font-size: 11.6pt;
body
background: $background
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment