godoc: use relative css unit

To scale the website elements independently of the default font size,
we use the css rem unit. This scales the elements proportionally if the
user has set a different font size than the default.

We make all calculations assuming that 1rem=16px, which is the
default font size for browsers.

Tested manually on FF 59 and Chrome 65 with permutations of different
resolutions and different default font-sizes upto 36px.

Fixes golang/go#6150

Change-Id: I7ded227ee2c55178271667009ab98ee0b4e7e8b3
Reviewed-on: https://go-review.googlesource.com/94935
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Agniva De Sarker 2018-02-02 14:45:40 +05:30 committed by Andrew Bonventre
parent 6e0e2181b9
commit 0b5ca0b040
2 changed files with 338 additions and 348 deletions

View File

@ -3004,17 +3004,18 @@ function PlaygroundOutput(el) {
"style.css": `body { "style.css": `body {
margin: 0; margin: 0;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
font-size: 16px;
background-color: #fff; background-color: #fff;
line-height: 1.3em; line-height: 1.3;
text-align: center;
color: #222;
} }
pre, pre,
code { code {
font-family: Menlo, monospace; font-family: Menlo, monospace;
font-size: 14px; font-size: 0.875rem;
} }
pre { pre {
line-height: 1.4em; line-height: 1.4;
overflow-x: auto; overflow-x: auto;
} }
pre .comment { pre .comment {
@ -3041,9 +3042,6 @@ pre .ln {
user-select: none; user-select: none;
} }
body {
color: #222;
}
a, a,
.exampleHeading .text { .exampleHeading .text {
color: #375EAB; color: #375EAB;
@ -3068,22 +3066,22 @@ a:hover,
} }
p, li { p, li {
max-width: 800px; max-width: 50rem;
word-wrap: break-word; word-wrap: break-word;
} }
p, p,
pre, pre,
ul, ul,
ol { ol {
margin: 20px; margin: 1.25rem;
} }
pre { pre {
background: #EFEFEF; background: #EFEFEF;
padding: 10px; padding: 0.625rem;
-webkit-border-radius: 5px; -webkit-border-radius: 0.3125rem;
-moz-border-radius: 5px; -moz-border-radius: 0.3125rem;
border-radius: 5px; border-radius: 0.3125rem;
} }
h1, h1,
@ -3091,22 +3089,22 @@ h2,
h3, h3,
h4, h4,
.rootHeading { .rootHeading {
margin: 20px 0 20px; margin: 1.25rem 0 1.25rem;
padding: 0; padding: 0;
color: #375EAB; color: #375EAB;
font-weight: bold; font-weight: bold;
} }
h1 { h1 {
font-size: 28px; font-size: 1.75rem;
line-height: 1; line-height: 1;
} }
h1 .text-muted { h1 .text-muted {
color:#777; color:#777;
} }
h2 { h2 {
font-size: 20px; font-size: 1.25rem;
background: #E0EBF5; background: #E0EBF5;
padding: 8px; padding: 0.5rem;
line-height: 1.25; line-height: 1.25;
font-weight: normal; font-weight: normal;
} }
@ -3114,47 +3112,46 @@ h2 a {
font-weight: bold; font-weight: bold;
} }
h3 { h3 {
font-size: 20px; font-size: 1.25rem;
} }
h3, h3,
h4 { h4 {
margin: 20px 5px; margin: 1.25rem 0.3125rem;
} }
h4 { h4 {
font-size: 16px; font-size: 1rem;
} }
.rootHeading { .rootHeading {
font-size: 20px; font-size: 1.25rem;
margin: 0; margin: 0;
} }
dl { dl {
margin: 20px; margin: 1.25rem;
} }
dd { dd {
margin: 0 0 0 20px; margin: 0 0 0 1.25rem;
} }
dl, dl,
dd { dd {
font-size: 14px; font-size: 0.875rem;
} }
div#nav table td { div#nav table td {
vertical-align: top; vertical-align: top;
} }
#pkg-index h3 { #pkg-index h3 {
font-size: 16px; font-size: 1rem;
} }
.pkg-dir { .pkg-dir {
padding: 0 10px; padding: 0 0.625rem;
} }
.pkg-dir table { .pkg-dir table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
} }
.pkg-name { .pkg-name {
padding-right: 10px; padding-right: 0.625rem;
} }
.alert { .alert {
color: #AA0000; color: #AA0000;
@ -3162,8 +3159,8 @@ div#nav table td {
.top-heading { .top-heading {
float: left; float: left;
padding: 21px 0; padding: 1.313rem 0;
font-size: 20px; font-size: 1.25rem;
font-weight: normal; font-weight: normal;
} }
.top-heading a { .top-heading a {
@ -3173,13 +3170,10 @@ div#nav table td {
div#topbar { div#topbar {
background: #E0EBF5; background: #E0EBF5;
height: 64px; height: 4rem;
overflow: hidden; overflow: hidden;
} }
body {
text-align: center;
}
div#page { div#page {
width: 100%; width: 100%;
} }
@ -3188,11 +3182,11 @@ div#topbar > .container {
text-align: left; text-align: left;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding: 0 20px; padding: 0 1.25rem;
} }
div#topbar > .container, div#topbar > .container,
div#page > .container { div#page > .container {
max-width: 950px; max-width: 59.38rem;
} }
div#page.wide > .container, div#page.wide > .container,
div#topbar.wide > .container { div#topbar.wide > .container {
@ -3201,14 +3195,14 @@ div#topbar.wide > .container {
div#plusone { div#plusone {
float: right; float: right;
clear: right; clear: right;
margin-top: 5px; margin-top: 0.3125rem;
} }
div#footer { div#footer {
text-align: center; text-align: center;
color: #666; color: #666;
font-size: 14px; font-size: 0.875rem;
margin: 40px 0; margin: 2.5rem 0;
} }
div#menu > a, div#menu > a,
@ -3217,20 +3211,20 @@ div#learn .buttons a,
div.play .buttons a, div.play .buttons a,
div#blog .read a, div#blog .read a,
#menu-button { #menu-button {
padding: 10px; padding: 0.625rem;
text-decoration: none; text-decoration: none;
font-size: 16px; font-size: 1rem;
-webkit-border-radius: 5px; -webkit-border-radius: 0.3125rem;
-moz-border-radius: 5px; -moz-border-radius: 0.3125rem;
border-radius: 5px; border-radius: 0.3125rem;
} }
div#playground .buttons a, div#playground .buttons a,
div#menu > a, div#menu > a,
input#search, input#search,
#menu-button { #menu-button {
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
} }
div#playground .buttons a, div#playground .buttons a,
div#menu > a, div#menu > a,
@ -3247,16 +3241,16 @@ div#learn .buttons a,
div.play .buttons a, div.play .buttons a,
div#blog .read a { div#blog .read a {
color: #222; color: #222;
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
background: #E0EBF5; background: #E0EBF5;
} }
.download { .download {
width: 150px; width: 9.375rem;
} }
div#menu { div#menu {
text-align: right; text-align: right;
padding: 10px; padding: 0.625rem;
white-space: nowrap; white-space: nowrap;
max-height: 0; max-height: 0;
-moz-transition: max-height .25s linear; -moz-transition: max-height .25s linear;
@ -3264,12 +3258,12 @@ div#menu {
width: 100%; width: 100%;
} }
div#menu.menu-visible { div#menu.menu-visible {
max-height: 500px; max-height: 31.25rem;
} }
div#menu > a, div#menu > a,
#menu-button { #menu-button {
margin: 10px 2px; margin: 0.625rem 0.125rem;
padding: 10px; padding: 0.625rem;
} }
::-webkit-input-placeholder { ::-webkit-input-placeholder {
color: #7f7f7f; color: #7f7f7f;
@ -3281,7 +3275,7 @@ div#menu > a,
} }
#menu .search-box { #menu .search-box {
display: inline-flex; display: inline-flex;
width: 140px; width: 8.75rem;
} }
input#search { input#search {
background: white; background: white;
@ -3294,7 +3288,7 @@ input#search {
margin-right: 0; margin-right: 0;
flex-grow: 1; flex-grow: 1;
max-width: 100%; max-width: 100%;
min-width: 90px; min-width: 5.625rem;
} }
input#search:-moz-ui-invalid { input#search:-moz-ui-invalid {
box-shadow: unset; box-shadow: unset;
@ -3304,11 +3298,11 @@ input#search + button {
font-size: 1em; font-size: 1em;
background-color: #375EAB; background-color: #375EAB;
color: white; color: white;
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 5px; border-top-right-radius: 0.3125rem;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 5px; border-bottom-right-radius: 0.3125rem;
margin-left: 0; margin-left: 0;
cursor: pointer; cursor: pointer;
} }
@ -3322,9 +3316,9 @@ input#search + button svg {
#menu-button { #menu-button {
display: none; display: none;
position: absolute; position: absolute;
right: 5px; right: 0.3125rem;
top: 0; top: 0;
margin-right: 5px; margin-right: 0.3125rem;
} }
#menu-button-arrow { #menu-button-arrow {
display: inline-block; display: inline-block;
@ -3350,71 +3344,72 @@ div.right {
div#learn, div#learn,
div#about { div#about {
padding-top: 20px; padding-top: 1.25rem;
} }
div#learn h2, div#learn h2,
div#about { div#about {
margin: 0; margin: 0;
} }
div#about { div#about {
font-size: 20px; font-size: 1.25rem;
margin: 0 auto 30px; margin: 0 auto 1.875rem;
} }
div#gopher { div#gopher {
background: url(/doc/gopher/frontpage.png) no-repeat; background: url(/doc/gopher/frontpage.png) no-repeat;
background-position: center top; background-position: center top;
height: 155px; height: 9.688rem;
max-height: 200px; /* Setting in px to prevent the gopher from blowing up in very high default font-sizes */
} }
a#start { a#start {
display: block; display: block;
padding: 10px; padding: 0.625rem;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
-webkit-border-radius: 5px; -webkit-border-radius: 0.3125rem;
-moz-border-radius: 5px; -moz-border-radius: 0.3125rem;
border-radius: 5px; border-radius: 0.3125rem;
} }
a#start .big { a#start .big {
display: block; display: block;
font-weight: bold; font-weight: bold;
font-size: 20px; font-size: 1.25rem;
} }
a#start .desc { a#start .desc {
display: block; display: block;
font-size: 14px; font-size: 0.875rem;
font-weight: normal; font-weight: normal;
margin-top: 5px; margin-top: 0.3125rem;
} }
div#learn .popout { div#learn .popout {
float: right; float: right;
display: block; display: block;
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: 0.75rem;
background: url(/doc/share.png) no-repeat; background: url(/doc/share.png) no-repeat;
background-position: right top; background-position: right center;
padding: 5px 27px; padding: 0.375rem 1.688rem;
} }
div#learn pre, div#learn pre,
div#learn textarea { div#learn textarea {
padding: 0; padding: 0;
margin: 0; margin: 0;
font-family: Menlo, monospace; font-family: Menlo, monospace;
font-size: 14px; font-size: 0.875rem;
} }
div#learn .input { div#learn .input {
padding: 10px; padding: 0.625rem;
margin-top: 10px; margin-top: 0.625rem;
height: 150px; height: 9.375rem;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 0.3125rem;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 0.3125rem;
-moz-border-radius-topleft: 5px; -moz-border-radius-topleft: 0.3125rem;
-moz-border-radius-topright: 5px; -moz-border-radius-topright: 0.3125rem;
border-top-left-radius: 5px; border-top-left-radius: 0.3125rem;
border-top-right-radius: 5px; border-top-right-radius: 0.3125rem;
} }
div#learn .input textarea { div#learn .input textarea {
width: 100%; width: 100%;
@ -3426,16 +3421,16 @@ div#learn .input textarea {
div#learn .output { div#learn .output {
border-top: none !important; border-top: none !important;
padding: 10px; padding: 0.625rem;
height: 59px; height: 3.688rem;
overflow: auto; overflow: auto;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 0.3125rem;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 0.3125rem;
-moz-border-radius-bottomright: 5px; -moz-border-radius-bottomright: 0.3125rem;
-moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomleft: 0.3125rem;
border-bottom-right-radius: 5px; border-bottom-right-radius: 0.3125rem;
border-bottom-left-radius: 5px; border-bottom-left-radius: 0.3125rem;
} }
div#learn .output pre { div#learn .output pre {
padding: 0; padding: 0;
@ -3452,23 +3447,24 @@ div#learn .output pre {
} }
div#learn .input, div#learn .input,
div#learn .output { div#learn .output {
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
} }
div#learn .buttons { div#learn .buttons {
float: right; float: right;
padding: 20px 0 10px 0; padding: 1.25rem 0 0.625rem 0;
text-align: right; text-align: right;
} }
div#learn .buttons a { div#learn .buttons a {
height: 16px; height: 1rem;
margin-left: 5px; margin-left: 0.3125rem;
padding: 10px; padding: 0.625rem;
} }
div#learn .toys { div#learn .toys {
margin-top: 8px; margin-top: 0.5rem;
} }
div#learn .toys select { div#learn .toys select {
border: 1px solid #375EAB; font-size: 0.875rem;
border: 0.0625rem solid #375EAB;
margin: 0; margin: 0;
} }
div#learn .output .exit { div#learn .output .exit {
@ -3480,7 +3476,7 @@ div#video {
} }
div#blog, div#blog,
div#video { div#video {
margin-top: 40px; margin-top: 2.5rem;
} }
div#blog > a, div#blog > a,
div#blog > div, div#blog > div,
@ -3488,16 +3484,16 @@ div#blog > h2,
div#video > a, div#video > a,
div#video > div, div#video > div,
div#video > h2 { div#video > h2 {
margin-bottom: 10px; margin-bottom: 0.625rem;
} }
div#blog .title, div#blog .title,
div#video .title { div#video .title {
display: block; display: block;
font-size: 20px; font-size: 1.25rem;
} }
div#blog .when { div#blog .when {
color: #666; color: #666;
font-size: 14px; font-size: 0.875rem;
} }
div#blog .read { div#blog .read {
text-align: right; text-align: right;
@ -3510,20 +3506,20 @@ div#blog .read {
.toggleVisible > .expanded { display: block; } .toggleVisible > .expanded { display: block; }
table.codetable { margin-left: auto; margin-right: auto; border-style: none; } table.codetable { margin-left: auto; margin-right: auto; border-style: none; }
table.codetable td { padding-right: 10px; } table.codetable td { padding-right: 0.625rem; }
hr { border-style: none; border-top: 1px solid black; } hr { border-style: none; border-top: 0.0625rem solid black; }
img.gopher { img.gopher {
float: right; float: right;
margin-left: 10px; margin-left: 0.625rem;
margin-bottom: 10px; margin-bottom: 0.625rem;
z-index: -1; z-index: -1;
} }
h2 { clear: right; } h2 { clear: right; }
/* example and drop-down playground */ /* example and drop-down playground */
div.play { div.play {
padding: 0 20px 40px 20px; padding: 0 1.25rem 2.5rem 1.25rem;
} }
div.play pre, div.play pre,
div.play textarea, div.play textarea,
@ -3531,18 +3527,18 @@ div.play .lines {
padding: 0; padding: 0;
margin: 0; margin: 0;
font-family: Menlo, monospace; font-family: Menlo, monospace;
font-size: 14px; font-size: 0.875rem;
} }
div.play .input { div.play .input {
padding: 10px; padding: 0.625rem;
margin-top: 10px; margin-top: 0.625rem;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 0.3125rem;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 0.3125rem;
-moz-border-radius-topleft: 5px; -moz-border-radius-topleft: 0.3125rem;
-moz-border-radius-topright: 5px; -moz-border-radius-topright: 0.3125rem;
border-top-left-radius: 5px; border-top-left-radius: 0.3125rem;
border-top-right-radius: 5px; border-top-right-radius: 0.3125rem;
overflow: hidden; overflow: hidden;
} }
@ -3562,16 +3558,16 @@ div#playground .input textarea {
div.play .output { div.play .output {
border-top: none !important; border-top: none !important;
padding: 10px; padding: 0.625rem;
max-height: 200px; max-height: 12.5rem;
overflow: auto; overflow: auto;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 0.3125rem;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 0.3125rem;
-moz-border-radius-bottomright: 5px; -moz-border-radius-bottomright: 0.3125rem;
-moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomleft: 0.3125rem;
border-bottom-right-radius: 5px; border-bottom-right-radius: 0.3125rem;
border-bottom-left-radius: 5px; border-bottom-left-radius: 0.3125rem;
} }
div.play .output pre { div.play .output pre {
padding: 0; padding: 0;
@ -3588,17 +3584,17 @@ div.play .output pre {
} }
div.play .input, div.play .input,
div.play .output { div.play .output {
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
} }
div.play .buttons { div.play .buttons {
float: right; float: right;
padding: 20px 0 10px 0; padding: 1.25rem 0 0.625rem 0;
text-align: right; text-align: right;
} }
div.play .buttons a { div.play .buttons a {
height: 16px; height: 1rem;
margin-left: 5px; margin-left: 0.3125rem;
padding: 10px; padding: 0.625rem;
cursor: pointer; cursor: pointer;
} }
.output .stderr { .output .stderr {
@ -3616,29 +3612,29 @@ div#playground {
} }
div#playground { div#playground {
position: absolute; position: absolute;
top: 63px; top: 3.938rem;
right: 20px; right: 1.25rem;
padding: 0 10px 10px 10px; padding: 0 0.625rem 0.625rem 0.625rem;
z-index: 1; z-index: 1;
text-align: left; text-align: left;
background: #E0EBF5; background: #E0EBF5;
border: 1px solid #B0BBC5; border: 0.0625rem solid #B0BBC5;
border-top: none; border-top: none;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 0.3125rem;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 0.3125rem;
-moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomleft: 0.3125rem;
-moz-border-radius-bottomright: 5px; -moz-border-radius-bottomright: 0.3125rem;
border-bottom-left-radius: 5px; border-bottom-left-radius: 0.3125rem;
border-bottom-right-radius: 5px; border-bottom-right-radius: 0.3125rem;
} }
div#playground .code { div#playground .code {
width: 520px; width: 32.5rem;
height: 200px; height: 12.5rem;
} }
div#playground .output { div#playground .output {
height: 100px; height: 6.25rem;
} }
/* Inline runnable snippets (play.js/initPlayground) */ /* Inline runnable snippets (play.js/initPlayground) */
@ -3647,7 +3643,7 @@ div#playground .output {
padding: 0; padding: 0;
background: none; background: none;
border: none; border: none;
outline: 0px solid transparent; outline: 0 solid transparent;
overflow: auto; overflow: auto;
} }
#content .playground .number, #content .code .number { #content .playground .number, #content .code .number {
@ -3655,11 +3651,11 @@ div#playground .output {
} }
#content .code, #content .playground, #content .output { #content .code, #content .playground, #content .output {
width: auto; width: auto;
margin: 20px; margin: 1.25rem;
padding: 10px; padding: 0.625rem;
-webkit-border-radius: 5px; -webkit-border-radius: 0.3125rem;
-moz-border-radius: 5px; -moz-border-radius: 0.3125rem;
border-radius: 5px; border-radius: 0.3125rem;
} }
#content .code, #content .playground { #content .code, #content .playground {
background: #e9e9e9; background: #e9e9e9;
@ -3679,11 +3675,11 @@ div#playground .output {
#content .buttons { #content .buttons {
position: relative; position: relative;
float: right; float: right;
top: -50px; top: -3.125rem;
right: 30px; right: 1.875rem;
} }
#content .output .buttons { #content .output .buttons {
top: -60px; top: -3.75rem;
right: 0; right: 0;
height: 0; height: 0;
} }
@ -3695,11 +3691,11 @@ a.error {
font-weight: bold; font-weight: bold;
color: white; color: white;
background-color: darkred; background-color: darkred;
border-bottom-left-radius: 4px; border-bottom-left-radius: 0.25rem;
border-bottom-right-radius: 4px; border-bottom-right-radius: 0.25rem;
border-top-left-radius: 4px; border-top-left-radius: 0.25rem;
border-top-right-radius: 4px; border-top-right-radius: 0.25rem;
padding: 2px 4px 2px 4px; /* TRBL */ padding: 0.125rem 0.25rem 0.125rem 0.25rem; /* TRBL */
} }
@ -3709,12 +3705,12 @@ a.error {
.downloading { .downloading {
background: #F9F9BE; background: #F9F9BE;
padding: 10px; padding: 0.625rem;
text-align: center; text-align: center;
border-radius: 5px; border-radius: 0.3125rem;
} }
@media (max-width: 930px) { @media (max-width: 58.125em) {
#heading-wide { #heading-wide {
display: none; display: none;
} }
@ -3723,8 +3719,7 @@ a.error {
} }
} }
@media (max-width: 47.5em) {
@media (max-width: 760px) {
.container .left, .container .left,
.container .right { .container .right {
width: auto; width: auto;
@ -3732,39 +3727,39 @@ a.error {
} }
div#about { div#about {
max-width: 500px; max-width: 31.25rem;
text-align: center; text-align: center;
} }
} }
@media (min-width: 700px) and (max-width: 1000px) { @media (min-width: 43.75em) and (max-width: 62.5em) {
div#menu > a { div#menu > a {
margin: 5px 0; margin: 0.3125rem 0;
font-size: 14px; font-size: 0.875rem;
} }
input#search { input#search {
font-size: 14px; font-size: 0.875rem;
} }
} }
@media (max-width: 700px) { @media (max-width: 43.75em) {
body { body {
font-size: 15px; font-size: 0.9375rem;
} }
pre, pre,
code { code {
font-size: 13px; font-size: 0.866rem;
} }
div#page > .container { div#page > .container {
padding: 0 10px; padding: 0 0.625rem;
} }
div#topbar { div#topbar {
height: auto; height: auto;
padding: 10px; padding: 0.625rem;
} }
div#topbar > .container { div#topbar > .container {
@ -3781,7 +3776,7 @@ a.error {
.top-heading { .top-heading {
float: none; float: none;
display: inline-block; display: inline-block;
padding: 12px; padding: 0.75rem;
} }
div#menu { div#menu {
@ -3810,7 +3805,7 @@ a.error {
pre, pre,
ul, ul,
ol { ol {
margin: 10px; margin: 0.625rem;
} }
.pkg-synopsis { .pkg-synopsis {
@ -3822,7 +3817,7 @@ a.error {
} }
} }
@media (max-width: 480px) { @media (max-width: 30em) {
#heading-wide { #heading-wide {
display: none; display: none;
} }
@ -3834,7 +3829,7 @@ a.error {
@media print { @media print {
pre { pre {
background: #FFF; background: #FFF;
border: 1px solid #BBB; border: 0.0625rem solid #BBB;
white-space: pre-wrap; white-space: pre-wrap;
} }
} }

View File

@ -1,17 +1,18 @@
body { body {
margin: 0; margin: 0;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
font-size: 16px;
background-color: #fff; background-color: #fff;
line-height: 1.3em; line-height: 1.3;
text-align: center;
color: #222;
} }
pre, pre,
code { code {
font-family: Menlo, monospace; font-family: Menlo, monospace;
font-size: 14px; font-size: 0.875rem;
} }
pre { pre {
line-height: 1.4em; line-height: 1.4;
overflow-x: auto; overflow-x: auto;
} }
pre .comment { pre .comment {
@ -38,9 +39,6 @@ pre .ln {
user-select: none; user-select: none;
} }
body {
color: #222;
}
a, a,
.exampleHeading .text { .exampleHeading .text {
color: #375EAB; color: #375EAB;
@ -65,22 +63,22 @@ a:hover,
} }
p, li { p, li {
max-width: 800px; max-width: 50rem;
word-wrap: break-word; word-wrap: break-word;
} }
p, p,
pre, pre,
ul, ul,
ol { ol {
margin: 20px; margin: 1.25rem;
} }
pre { pre {
background: #EFEFEF; background: #EFEFEF;
padding: 10px; padding: 0.625rem;
-webkit-border-radius: 5px; -webkit-border-radius: 0.3125rem;
-moz-border-radius: 5px; -moz-border-radius: 0.3125rem;
border-radius: 5px; border-radius: 0.3125rem;
} }
h1, h1,
@ -88,22 +86,22 @@ h2,
h3, h3,
h4, h4,
.rootHeading { .rootHeading {
margin: 20px 0 20px; margin: 1.25rem 0 1.25rem;
padding: 0; padding: 0;
color: #375EAB; color: #375EAB;
font-weight: bold; font-weight: bold;
} }
h1 { h1 {
font-size: 28px; font-size: 1.75rem;
line-height: 1; line-height: 1;
} }
h1 .text-muted { h1 .text-muted {
color:#777; color:#777;
} }
h2 { h2 {
font-size: 20px; font-size: 1.25rem;
background: #E0EBF5; background: #E0EBF5;
padding: 8px; padding: 0.5rem;
line-height: 1.25; line-height: 1.25;
font-weight: normal; font-weight: normal;
} }
@ -111,47 +109,46 @@ h2 a {
font-weight: bold; font-weight: bold;
} }
h3 { h3 {
font-size: 20px; font-size: 1.25rem;
} }
h3, h3,
h4 { h4 {
margin: 20px 5px; margin: 1.25rem 0.3125rem;
} }
h4 { h4 {
font-size: 16px; font-size: 1rem;
} }
.rootHeading { .rootHeading {
font-size: 20px; font-size: 1.25rem;
margin: 0; margin: 0;
} }
dl { dl {
margin: 20px; margin: 1.25rem;
} }
dd { dd {
margin: 0 0 0 20px; margin: 0 0 0 1.25rem;
} }
dl, dl,
dd { dd {
font-size: 14px; font-size: 0.875rem;
} }
div#nav table td { div#nav table td {
vertical-align: top; vertical-align: top;
} }
#pkg-index h3 { #pkg-index h3 {
font-size: 16px; font-size: 1rem;
} }
.pkg-dir { .pkg-dir {
padding: 0 10px; padding: 0 0.625rem;
} }
.pkg-dir table { .pkg-dir table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
} }
.pkg-name { .pkg-name {
padding-right: 10px; padding-right: 0.625rem;
} }
.alert { .alert {
color: #AA0000; color: #AA0000;
@ -159,8 +156,8 @@ div#nav table td {
.top-heading { .top-heading {
float: left; float: left;
padding: 21px 0; padding: 1.313rem 0;
font-size: 20px; font-size: 1.25rem;
font-weight: normal; font-weight: normal;
} }
.top-heading a { .top-heading a {
@ -170,13 +167,10 @@ div#nav table td {
div#topbar { div#topbar {
background: #E0EBF5; background: #E0EBF5;
height: 64px; height: 4rem;
overflow: hidden; overflow: hidden;
} }
body {
text-align: center;
}
div#page { div#page {
width: 100%; width: 100%;
} }
@ -185,11 +179,11 @@ div#topbar > .container {
text-align: left; text-align: left;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding: 0 20px; padding: 0 1.25rem;
} }
div#topbar > .container, div#topbar > .container,
div#page > .container { div#page > .container {
max-width: 950px; max-width: 59.38rem;
} }
div#page.wide > .container, div#page.wide > .container,
div#topbar.wide > .container { div#topbar.wide > .container {
@ -198,14 +192,14 @@ div#topbar.wide > .container {
div#plusone { div#plusone {
float: right; float: right;
clear: right; clear: right;
margin-top: 5px; margin-top: 0.3125rem;
} }
div#footer { div#footer {
text-align: center; text-align: center;
color: #666; color: #666;
font-size: 14px; font-size: 0.875rem;
margin: 40px 0; margin: 2.5rem 0;
} }
div#menu > a, div#menu > a,
@ -214,20 +208,20 @@ div#learn .buttons a,
div.play .buttons a, div.play .buttons a,
div#blog .read a, div#blog .read a,
#menu-button { #menu-button {
padding: 10px; padding: 0.625rem;
text-decoration: none; text-decoration: none;
font-size: 16px; font-size: 1rem;
-webkit-border-radius: 5px; -webkit-border-radius: 0.3125rem;
-moz-border-radius: 5px; -moz-border-radius: 0.3125rem;
border-radius: 5px; border-radius: 0.3125rem;
} }
div#playground .buttons a, div#playground .buttons a,
div#menu > a, div#menu > a,
input#search, input#search,
#menu-button { #menu-button {
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
} }
div#playground .buttons a, div#playground .buttons a,
div#menu > a, div#menu > a,
@ -244,16 +238,16 @@ div#learn .buttons a,
div.play .buttons a, div.play .buttons a,
div#blog .read a { div#blog .read a {
color: #222; color: #222;
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
background: #E0EBF5; background: #E0EBF5;
} }
.download { .download {
width: 150px; width: 9.375rem;
} }
div#menu { div#menu {
text-align: right; text-align: right;
padding: 10px; padding: 0.625rem;
white-space: nowrap; white-space: nowrap;
max-height: 0; max-height: 0;
-moz-transition: max-height .25s linear; -moz-transition: max-height .25s linear;
@ -261,12 +255,12 @@ div#menu {
width: 100%; width: 100%;
} }
div#menu.menu-visible { div#menu.menu-visible {
max-height: 500px; max-height: 31.25rem;
} }
div#menu > a, div#menu > a,
#menu-button { #menu-button {
margin: 10px 2px; margin: 0.625rem 0.125rem;
padding: 10px; padding: 0.625rem;
} }
::-webkit-input-placeholder { ::-webkit-input-placeholder {
color: #7f7f7f; color: #7f7f7f;
@ -278,7 +272,7 @@ div#menu > a,
} }
#menu .search-box { #menu .search-box {
display: inline-flex; display: inline-flex;
width: 140px; width: 8.75rem;
} }
input#search { input#search {
background: white; background: white;
@ -291,7 +285,7 @@ input#search {
margin-right: 0; margin-right: 0;
flex-grow: 1; flex-grow: 1;
max-width: 100%; max-width: 100%;
min-width: 90px; min-width: 5.625rem;
} }
input#search:-moz-ui-invalid { input#search:-moz-ui-invalid {
box-shadow: unset; box-shadow: unset;
@ -301,11 +295,11 @@ input#search + button {
font-size: 1em; font-size: 1em;
background-color: #375EAB; background-color: #375EAB;
color: white; color: white;
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 5px; border-top-right-radius: 0.3125rem;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 5px; border-bottom-right-radius: 0.3125rem;
margin-left: 0; margin-left: 0;
cursor: pointer; cursor: pointer;
} }
@ -319,9 +313,9 @@ input#search + button svg {
#menu-button { #menu-button {
display: none; display: none;
position: absolute; position: absolute;
right: 5px; right: 0.3125rem;
top: 0; top: 0;
margin-right: 5px; margin-right: 0.3125rem;
} }
#menu-button-arrow { #menu-button-arrow {
display: inline-block; display: inline-block;
@ -347,71 +341,72 @@ div.right {
div#learn, div#learn,
div#about { div#about {
padding-top: 20px; padding-top: 1.25rem;
} }
div#learn h2, div#learn h2,
div#about { div#about {
margin: 0; margin: 0;
} }
div#about { div#about {
font-size: 20px; font-size: 1.25rem;
margin: 0 auto 30px; margin: 0 auto 1.875rem;
} }
div#gopher { div#gopher {
background: url(/doc/gopher/frontpage.png) no-repeat; background: url(/doc/gopher/frontpage.png) no-repeat;
background-position: center top; background-position: center top;
height: 155px; height: 9.688rem;
max-height: 200px; /* Setting in px to prevent the gopher from blowing up in very high default font-sizes */
} }
a#start { a#start {
display: block; display: block;
padding: 10px; padding: 0.625rem;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
-webkit-border-radius: 5px; -webkit-border-radius: 0.3125rem;
-moz-border-radius: 5px; -moz-border-radius: 0.3125rem;
border-radius: 5px; border-radius: 0.3125rem;
} }
a#start .big { a#start .big {
display: block; display: block;
font-weight: bold; font-weight: bold;
font-size: 20px; font-size: 1.25rem;
} }
a#start .desc { a#start .desc {
display: block; display: block;
font-size: 14px; font-size: 0.875rem;
font-weight: normal; font-weight: normal;
margin-top: 5px; margin-top: 0.3125rem;
} }
div#learn .popout { div#learn .popout {
float: right; float: right;
display: block; display: block;
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: 0.75rem;
background: url(/doc/share.png) no-repeat; background: url(/doc/share.png) no-repeat;
background-position: right top; background-position: right center;
padding: 5px 27px; padding: 0.375rem 1.688rem;
} }
div#learn pre, div#learn pre,
div#learn textarea { div#learn textarea {
padding: 0; padding: 0;
margin: 0; margin: 0;
font-family: Menlo, monospace; font-family: Menlo, monospace;
font-size: 14px; font-size: 0.875rem;
} }
div#learn .input { div#learn .input {
padding: 10px; padding: 0.625rem;
margin-top: 10px; margin-top: 0.625rem;
height: 150px; height: 9.375rem;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 0.3125rem;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 0.3125rem;
-moz-border-radius-topleft: 5px; -moz-border-radius-topleft: 0.3125rem;
-moz-border-radius-topright: 5px; -moz-border-radius-topright: 0.3125rem;
border-top-left-radius: 5px; border-top-left-radius: 0.3125rem;
border-top-right-radius: 5px; border-top-right-radius: 0.3125rem;
} }
div#learn .input textarea { div#learn .input textarea {
width: 100%; width: 100%;
@ -423,16 +418,16 @@ div#learn .input textarea {
div#learn .output { div#learn .output {
border-top: none !important; border-top: none !important;
padding: 10px; padding: 0.625rem;
height: 59px; height: 3.688rem;
overflow: auto; overflow: auto;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 0.3125rem;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 0.3125rem;
-moz-border-radius-bottomright: 5px; -moz-border-radius-bottomright: 0.3125rem;
-moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomleft: 0.3125rem;
border-bottom-right-radius: 5px; border-bottom-right-radius: 0.3125rem;
border-bottom-left-radius: 5px; border-bottom-left-radius: 0.3125rem;
} }
div#learn .output pre { div#learn .output pre {
padding: 0; padding: 0;
@ -449,23 +444,24 @@ div#learn .output pre {
} }
div#learn .input, div#learn .input,
div#learn .output { div#learn .output {
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
} }
div#learn .buttons { div#learn .buttons {
float: right; float: right;
padding: 20px 0 10px 0; padding: 1.25rem 0 0.625rem 0;
text-align: right; text-align: right;
} }
div#learn .buttons a { div#learn .buttons a {
height: 16px; height: 1rem;
margin-left: 5px; margin-left: 0.3125rem;
padding: 10px; padding: 0.625rem;
} }
div#learn .toys { div#learn .toys {
margin-top: 8px; margin-top: 0.5rem;
} }
div#learn .toys select { div#learn .toys select {
border: 1px solid #375EAB; font-size: 0.875rem;
border: 0.0625rem solid #375EAB;
margin: 0; margin: 0;
} }
div#learn .output .exit { div#learn .output .exit {
@ -477,7 +473,7 @@ div#video {
} }
div#blog, div#blog,
div#video { div#video {
margin-top: 40px; margin-top: 2.5rem;
} }
div#blog > a, div#blog > a,
div#blog > div, div#blog > div,
@ -485,16 +481,16 @@ div#blog > h2,
div#video > a, div#video > a,
div#video > div, div#video > div,
div#video > h2 { div#video > h2 {
margin-bottom: 10px; margin-bottom: 0.625rem;
} }
div#blog .title, div#blog .title,
div#video .title { div#video .title {
display: block; display: block;
font-size: 20px; font-size: 1.25rem;
} }
div#blog .when { div#blog .when {
color: #666; color: #666;
font-size: 14px; font-size: 0.875rem;
} }
div#blog .read { div#blog .read {
text-align: right; text-align: right;
@ -507,20 +503,20 @@ div#blog .read {
.toggleVisible > .expanded { display: block; } .toggleVisible > .expanded { display: block; }
table.codetable { margin-left: auto; margin-right: auto; border-style: none; } table.codetable { margin-left: auto; margin-right: auto; border-style: none; }
table.codetable td { padding-right: 10px; } table.codetable td { padding-right: 0.625rem; }
hr { border-style: none; border-top: 1px solid black; } hr { border-style: none; border-top: 0.0625rem solid black; }
img.gopher { img.gopher {
float: right; float: right;
margin-left: 10px; margin-left: 0.625rem;
margin-bottom: 10px; margin-bottom: 0.625rem;
z-index: -1; z-index: -1;
} }
h2 { clear: right; } h2 { clear: right; }
/* example and drop-down playground */ /* example and drop-down playground */
div.play { div.play {
padding: 0 20px 40px 20px; padding: 0 1.25rem 2.5rem 1.25rem;
} }
div.play pre, div.play pre,
div.play textarea, div.play textarea,
@ -528,18 +524,18 @@ div.play .lines {
padding: 0; padding: 0;
margin: 0; margin: 0;
font-family: Menlo, monospace; font-family: Menlo, monospace;
font-size: 14px; font-size: 0.875rem;
} }
div.play .input { div.play .input {
padding: 10px; padding: 0.625rem;
margin-top: 10px; margin-top: 0.625rem;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 0.3125rem;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 0.3125rem;
-moz-border-radius-topleft: 5px; -moz-border-radius-topleft: 0.3125rem;
-moz-border-radius-topright: 5px; -moz-border-radius-topright: 0.3125rem;
border-top-left-radius: 5px; border-top-left-radius: 0.3125rem;
border-top-right-radius: 5px; border-top-right-radius: 0.3125rem;
overflow: hidden; overflow: hidden;
} }
@ -559,16 +555,16 @@ div#playground .input textarea {
div.play .output { div.play .output {
border-top: none !important; border-top: none !important;
padding: 10px; padding: 0.625rem;
max-height: 200px; max-height: 12.5rem;
overflow: auto; overflow: auto;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 0.3125rem;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 0.3125rem;
-moz-border-radius-bottomright: 5px; -moz-border-radius-bottomright: 0.3125rem;
-moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomleft: 0.3125rem;
border-bottom-right-radius: 5px; border-bottom-right-radius: 0.3125rem;
border-bottom-left-radius: 5px; border-bottom-left-radius: 0.3125rem;
} }
div.play .output pre { div.play .output pre {
padding: 0; padding: 0;
@ -585,17 +581,17 @@ div.play .output pre {
} }
div.play .input, div.play .input,
div.play .output { div.play .output {
border: 1px solid #375EAB; border: 0.0625rem solid #375EAB;
} }
div.play .buttons { div.play .buttons {
float: right; float: right;
padding: 20px 0 10px 0; padding: 1.25rem 0 0.625rem 0;
text-align: right; text-align: right;
} }
div.play .buttons a { div.play .buttons a {
height: 16px; height: 1rem;
margin-left: 5px; margin-left: 0.3125rem;
padding: 10px; padding: 0.625rem;
cursor: pointer; cursor: pointer;
} }
.output .stderr { .output .stderr {
@ -613,29 +609,29 @@ div#playground {
} }
div#playground { div#playground {
position: absolute; position: absolute;
top: 63px; top: 3.938rem;
right: 20px; right: 1.25rem;
padding: 0 10px 10px 10px; padding: 0 0.625rem 0.625rem 0.625rem;
z-index: 1; z-index: 1;
text-align: left; text-align: left;
background: #E0EBF5; background: #E0EBF5;
border: 1px solid #B0BBC5; border: 0.0625rem solid #B0BBC5;
border-top: none; border-top: none;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 0.3125rem;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 0.3125rem;
-moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomleft: 0.3125rem;
-moz-border-radius-bottomright: 5px; -moz-border-radius-bottomright: 0.3125rem;
border-bottom-left-radius: 5px; border-bottom-left-radius: 0.3125rem;
border-bottom-right-radius: 5px; border-bottom-right-radius: 0.3125rem;
} }
div#playground .code { div#playground .code {
width: 520px; width: 32.5rem;
height: 200px; height: 12.5rem;
} }
div#playground .output { div#playground .output {
height: 100px; height: 6.25rem;
} }
/* Inline runnable snippets (play.js/initPlayground) */ /* Inline runnable snippets (play.js/initPlayground) */
@ -644,7 +640,7 @@ div#playground .output {
padding: 0; padding: 0;
background: none; background: none;
border: none; border: none;
outline: 0px solid transparent; outline: 0 solid transparent;
overflow: auto; overflow: auto;
} }
#content .playground .number, #content .code .number { #content .playground .number, #content .code .number {
@ -652,11 +648,11 @@ div#playground .output {
} }
#content .code, #content .playground, #content .output { #content .code, #content .playground, #content .output {
width: auto; width: auto;
margin: 20px; margin: 1.25rem;
padding: 10px; padding: 0.625rem;
-webkit-border-radius: 5px; -webkit-border-radius: 0.3125rem;
-moz-border-radius: 5px; -moz-border-radius: 0.3125rem;
border-radius: 5px; border-radius: 0.3125rem;
} }
#content .code, #content .playground { #content .code, #content .playground {
background: #e9e9e9; background: #e9e9e9;
@ -676,11 +672,11 @@ div#playground .output {
#content .buttons { #content .buttons {
position: relative; position: relative;
float: right; float: right;
top: -50px; top: -3.125rem;
right: 30px; right: 1.875rem;
} }
#content .output .buttons { #content .output .buttons {
top: -60px; top: -3.75rem;
right: 0; right: 0;
height: 0; height: 0;
} }
@ -692,11 +688,11 @@ a.error {
font-weight: bold; font-weight: bold;
color: white; color: white;
background-color: darkred; background-color: darkred;
border-bottom-left-radius: 4px; border-bottom-left-radius: 0.25rem;
border-bottom-right-radius: 4px; border-bottom-right-radius: 0.25rem;
border-top-left-radius: 4px; border-top-left-radius: 0.25rem;
border-top-right-radius: 4px; border-top-right-radius: 0.25rem;
padding: 2px 4px 2px 4px; /* TRBL */ padding: 0.125rem 0.25rem 0.125rem 0.25rem; /* TRBL */
} }
@ -706,12 +702,12 @@ a.error {
.downloading { .downloading {
background: #F9F9BE; background: #F9F9BE;
padding: 10px; padding: 0.625rem;
text-align: center; text-align: center;
border-radius: 5px; border-radius: 0.3125rem;
} }
@media (max-width: 930px) { @media (max-width: 58.125em) {
#heading-wide { #heading-wide {
display: none; display: none;
} }
@ -720,8 +716,7 @@ a.error {
} }
} }
@media (max-width: 47.5em) {
@media (max-width: 760px) {
.container .left, .container .left,
.container .right { .container .right {
width: auto; width: auto;
@ -729,39 +724,39 @@ a.error {
} }
div#about { div#about {
max-width: 500px; max-width: 31.25rem;
text-align: center; text-align: center;
} }
} }
@media (min-width: 700px) and (max-width: 1000px) { @media (min-width: 43.75em) and (max-width: 62.5em) {
div#menu > a { div#menu > a {
margin: 5px 0; margin: 0.3125rem 0;
font-size: 14px; font-size: 0.875rem;
} }
input#search { input#search {
font-size: 14px; font-size: 0.875rem;
} }
} }
@media (max-width: 700px) { @media (max-width: 43.75em) {
body { body {
font-size: 15px; font-size: 0.9375rem;
} }
pre, pre,
code { code {
font-size: 13px; font-size: 0.866rem;
} }
div#page > .container { div#page > .container {
padding: 0 10px; padding: 0 0.625rem;
} }
div#topbar { div#topbar {
height: auto; height: auto;
padding: 10px; padding: 0.625rem;
} }
div#topbar > .container { div#topbar > .container {
@ -778,7 +773,7 @@ a.error {
.top-heading { .top-heading {
float: none; float: none;
display: inline-block; display: inline-block;
padding: 12px; padding: 0.75rem;
} }
div#menu { div#menu {
@ -807,7 +802,7 @@ a.error {
pre, pre,
ul, ul,
ol { ol {
margin: 10px; margin: 0.625rem;
} }
.pkg-synopsis { .pkg-synopsis {
@ -819,7 +814,7 @@ a.error {
} }
} }
@media (max-width: 480px) { @media (max-width: 30em) {
#heading-wide { #heading-wide {
display: none; display: none;
} }
@ -831,7 +826,7 @@ a.error {
@media print { @media print {
pre { pre {
background: #FFF; background: #FFF;
border: 1px solid #BBB; border: 0.0625rem solid #BBB;
white-space: pre-wrap; white-space: pre-wrap;
} }
} }