From 1bbacae1af54b43389540045621461bb026e93e7 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 30 Oct 2020 16:19:03 +0100 Subject: [PATCH 1/2] Remove rustdoc CSS files import from non-rustdoc pages --- templates/base.html | 2 - templates/style/base.scss | 103 +++++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 3 deletions(-) diff --git a/templates/base.html b/templates/base.html index 912ac2ec9..13b975482 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,8 +12,6 @@ {# Docs.rs styles #} - - {%- block css -%}{%- endblock css -%} diff --git a/templates/style/base.scss b/templates/style/base.scss index 6940b8959..22d8ec0f6 100644 --- a/templates/style/base.scss +++ b/templates/style/base.scss @@ -1,6 +1,56 @@ // FIXME: Use modules @import "vars", "utils", "navbar", "themes", "fa"; +/* See FiraSans-LICENSE.txt for the Fira Sans license. */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 400; + src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff'); +} +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 500; + src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff'); +} + +/* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license. */ +@font-face { + font-family: 'Source Serif Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Serif Pro'), url("SourceSerifPro-Regular.ttf.woff") format('woff'); +} +@font-face { + font-family: 'Source Serif Pro'; + font-style: italic; + font-weight: 400; + src: local('Source Serif Pro Italic'), url("SourceSerifPro-It.ttf.woff") format('woff'); +} +@font-face { + font-family: 'Source Serif Pro'; + font-style: normal; + font-weight: 700; + src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.ttf.woff") format('woff'); +} + +/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */ +@font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 400; + /* Avoid using locally installed font because bad versions are in circulation: + * see https://github.com/rust-lang/rust/issues/24355 */ + src: url("SourceCodePro-Regular.woff") format('woff'); +} +@font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 600; + src: url("SourceCodePro-Semibold.woff") format('woff'); +} + html, input, select, @@ -25,12 +75,62 @@ body { padding: 0; margin: 0; + * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + + h1 { + font-size: 1.5em; + } + h3 { + font-size: 1.3em; + } + h1, h2, h3, h4 { + font-family: "Fira Sans",sans-serif; + font-weight: 500; + margin: 20px 0 15px 0; + padding-bottom: 6px; + } + h2, h3, h4 { + border-bottom: 1px solid; + } + pre { + background-color: #F5F5F5; + padding: 14px; + } + code, kbd, pre, samp { + font-family: "Source Code Pro",monospace; + } + a { + text-decoration: none; + background: transparent; + } + p { + margin: 0 0 .6em 0; + } + ol, ul { + padding-left: 25px; + } + input, #search { background-color: var(--color-background-input); color: var(--input-color); + line-height: normal; } #search { + -moz-box-sizing: border-box !important; + box-sizing: border-box !important; + outline: none; + border: none; + border-radius: 1px; + margin-top: 5px; + padding: 10px 16px; + font-size: 17px; + width: 100%; + box-shadow: 0 0 0 1px var(--color-border), 0 0 0 1px var(--color-border); transition: box-shadow 150ms ease-in-out; } @@ -89,7 +189,8 @@ div.landing { h1.brand { font-size: 3em; - margin-bottom: 10px; + margin: 20px 0 10px 0; + padding-bottom: 6px; color: var(--color-brand); } From a5e0120d035036b93701be52fbf35f240b37774e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 30 Oct 2020 19:49:19 +0100 Subject: [PATCH 2/2] Remove normalize.css --- templates/base.html | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/base.html b/templates/base.html index 13b975482..50752830f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -11,7 +11,6 @@ {# Docs.rs styles #} - {%- block css -%}{%- endblock css -%}