diff --git a/README.md b/README.md index b728007..01e8fe4 100644 --- a/README.md +++ b/README.md @@ -38,5 +38,8 @@ without updating those repositories: - `docs/stylesheets/shared.css`, served at , is loaded by the docs sites of cpp-linter-action, cpp-linter, clang-tools-pip and cpp-linter-rs. + It carries the site's look (colors, header, fonts), so a change to it changes all of them. +- `docs/fonts/`, served at , holds the fonts that + `shared.css` declares (SIL Open Font License 1.1). Keep the file names in sync with it. - `docs/install-wheel.sh`, served at , is used by the clang-tools-wheel README and its release workflow. diff --git a/docs/fonts/OFL-bricolage-grotesque.txt b/docs/fonts/OFL-bricolage-grotesque.txt new file mode 100644 index 0000000..4dfd4fe --- /dev/null +++ b/docs/fonts/OFL-bricolage-grotesque.txt @@ -0,0 +1,93 @@ +Copyright 2022 The Bricolage Grotesque Project Authors (https://github.com/ateliertriay/bricolage) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/fonts/OFL-instrument-sans.txt b/docs/fonts/OFL-instrument-sans.txt new file mode 100644 index 0000000..d41633c --- /dev/null +++ b/docs/fonts/OFL-instrument-sans.txt @@ -0,0 +1,93 @@ +Copyright 2022 The Instrument Sans Project Authors (https://github.com/Instrument/instrument-sans) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/fonts/OFL-jetbrains-mono.txt b/docs/fonts/OFL-jetbrains-mono.txt new file mode 100644 index 0000000..821a3da --- /dev/null +++ b/docs/fonts/OFL-jetbrains-mono.txt @@ -0,0 +1,93 @@ +Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/fonts/bricolage-grotesque-latin-ext.woff2 b/docs/fonts/bricolage-grotesque-latin-ext.woff2 new file mode 100644 index 0000000..f1d35c1 Binary files /dev/null and b/docs/fonts/bricolage-grotesque-latin-ext.woff2 differ diff --git a/docs/fonts/bricolage-grotesque-latin.woff2 b/docs/fonts/bricolage-grotesque-latin.woff2 new file mode 100644 index 0000000..b908aff Binary files /dev/null and b/docs/fonts/bricolage-grotesque-latin.woff2 differ diff --git a/docs/fonts/instrument-sans-italic-latin-ext.woff2 b/docs/fonts/instrument-sans-italic-latin-ext.woff2 new file mode 100644 index 0000000..0f78b67 Binary files /dev/null and b/docs/fonts/instrument-sans-italic-latin-ext.woff2 differ diff --git a/docs/fonts/instrument-sans-italic-latin.woff2 b/docs/fonts/instrument-sans-italic-latin.woff2 new file mode 100644 index 0000000..b4f9b28 Binary files /dev/null and b/docs/fonts/instrument-sans-italic-latin.woff2 differ diff --git a/docs/fonts/instrument-sans-latin-ext.woff2 b/docs/fonts/instrument-sans-latin-ext.woff2 new file mode 100644 index 0000000..138162d Binary files /dev/null and b/docs/fonts/instrument-sans-latin-ext.woff2 differ diff --git a/docs/fonts/instrument-sans-latin.woff2 b/docs/fonts/instrument-sans-latin.woff2 new file mode 100644 index 0000000..665fa65 Binary files /dev/null and b/docs/fonts/instrument-sans-latin.woff2 differ diff --git a/docs/fonts/jetbrains-mono-italic-latin-ext.woff2 b/docs/fonts/jetbrains-mono-italic-latin-ext.woff2 new file mode 100644 index 0000000..6e1283e Binary files /dev/null and b/docs/fonts/jetbrains-mono-italic-latin-ext.woff2 differ diff --git a/docs/fonts/jetbrains-mono-italic-latin.woff2 b/docs/fonts/jetbrains-mono-italic-latin.woff2 new file mode 100644 index 0000000..5613180 Binary files /dev/null and b/docs/fonts/jetbrains-mono-italic-latin.woff2 differ diff --git a/docs/fonts/jetbrains-mono-latin-ext.woff2 b/docs/fonts/jetbrains-mono-latin-ext.woff2 new file mode 100644 index 0000000..310fadd Binary files /dev/null and b/docs/fonts/jetbrains-mono-latin-ext.woff2 differ diff --git a/docs/fonts/jetbrains-mono-latin.woff2 b/docs/fonts/jetbrains-mono-latin.woff2 new file mode 100644 index 0000000..2ca6ac6 Binary files /dev/null and b/docs/fonts/jetbrains-mono-latin.woff2 differ diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 558c5da..8701052 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -1,15 +1,16 @@ {% extends "base.html" %} {#- - The site's fonts, loaded on every page: Instrument Sans for text, - JetBrains Mono for code and Bricolage Grotesque for headings. theme.font is - false in mkdocs.yml, so Material loads nothing itself; extra.css points - Material's font variables at these. + The site's fonts are self-hosted in docs/fonts and declared in shared.css: + Instrument Sans for text, JetBrains Mono for code and Bricolage Grotesque for + headings. theme.font is false in mkdocs.yml, so Material loads nothing itself. + Preloading the latin files for text and headings lets the browser fetch them + while it is still reading the stylesheets. The URLs must match the ones in + shared.css, and crossorigin is required for fonts even on the same origin. -#} {% block extrahead %} {{ super() }} - - - + + {% endblock %} diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index eae55ee..0033f53 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -20,69 +20,6 @@ box-shadow: 0 8px 12px rgba(0,0,0,0.2); } -/* Code block enhancements */ -.md-typeset pre > code { - border-radius: 0.5rem; -} - -/* Fonts: loaded in overrides/main.html (theme.font is false) */ -:root { - --md-text-font: "Instrument Sans"; - --md-code-font: "JetBrains Mono"; -} - -.md-typeset h1, -.md-typeset h2, -.md-typeset h3, -.md-header__topic:first-child { - font-family: "Bricolage Grotesque", var(--md-text-font-family); - letter-spacing: -0.01em; -} - -.md-typeset h1 { - color: var(--md-default-fg-color); - font-weight: 760; -} - -.md-typeset h2, -.md-typeset h3 { - font-weight: 700; -} - -/* Buttons in the shape and colors of the home page buttons */ -.md-typeset .md-button { - padding: 0.6em 1.3em; - background-color: var(--cl-button-bg); - border: 1px solid var(--cl-button-line); - border-radius: 12px; - color: var(--cl-button-fg); - font-weight: 600; - transition: background-color 0.2s, border-color 0.2s; -} - -.md-typeset .md-button:focus, -.md-typeset .md-button:hover { - background-color: var(--cl-button-bg); - border-color: var(--cl-button-line-hover); - color: var(--cl-button-fg); -} - -.md-typeset .md-button--primary, -.md-typeset .md-button--primary:focus, -.md-typeset .md-button--primary:hover { - border-color: transparent; - color: #fff; -} - -.md-typeset .md-button--primary { - background-color: #4051b5; -} - -.md-typeset .md-button--primary:focus, -.md-typeset .md-button--primary:hover { - background-color: var(--cl-button-primary-hover); -} - /* Pages without the left navigation keep their text at a readable width */ @media screen and (min-width: 76.25em) { .md-sidebar--primary[hidden] ~ .md-content { @@ -109,155 +46,3 @@ .md-typeset .compare table:not([class]) td:first-child { font-weight: 600; } - -/* - * Light scheme: the paper, ink and light header of the home page. - */ -[data-md-color-scheme="default"] { - --md-default-fg-color: #171a2ede; - --md-default-fg-color--light: #171a2e8f; - --md-default-fg-color--lighter: #171a2e52; - --md-default-fg-color--lightest: #171a2e12; - --md-default-bg-color: #f7f5ef; - --md-code-bg-color: #eeeae0; - --md-code-bg-color--light: #eeeae0b3; - --md-code-bg-color--lighter: #eeeae04d; - --md-footer-bg-color: #171a2e; - --md-footer-bg-color--dark: #10131f; - --md-accent-fg-color: #2b3685; - --md-accent-fg-color--transparent: #2b36851a; - --cl-button-bg: #fff; - --cl-button-line: #d8d3c4; - --cl-button-line-hover: #bdb6a2; - --cl-button-fg: #171a2e; - --cl-button-primary-hover: #2b3685; -} - -[data-md-color-scheme="default"] .md-header, -[data-md-color-scheme="default"] .md-tabs { - background-color: #f7f5ef; - color: #171a2e; -} - -[data-md-color-scheme="default"] .md-header { - border-bottom: 1px solid #e3dfd3; -} - -[data-md-color-scheme="default"] .md-tabs__link { - color: #454a63; - opacity: 1; -} - -[data-md-color-scheme="default"] .md-tabs__item--active .md-tabs__link, -[data-md-color-scheme="default"] .md-tabs__link:hover { - color: #171a2e; -} - -[data-md-color-scheme="default"] .md-tabs__item--active .md-tabs__link { - font-weight: 700; -} - -[data-md-color-scheme="default"] .md-nav--primary .md-nav__title[for="__drawer"] { - background-color: #f7f5ef; - color: #171a2e; -} - -[data-md-color-scheme="default"] .md-nav__source { - background-color: #171a2e; -} - -@media screen and (min-width: 60em) { - [data-md-color-scheme="default"] .md-search__form, - [data-md-color-scheme="default"] .md-search__form:hover { - background-color: #fff; - border: 1px solid #d8d3c4; - border-radius: 0.4rem; - } - - [data-md-color-scheme="default"] .md-search__input::placeholder { - color: #62677f; - } - - [data-md-color-scheme="default"] .md-search__input + .md-search__icon { - color: #454a63; - } -} - -/* Dark scheme: the same layout in the ink tones of the home page */ -[data-md-color-scheme="slate"] { - --md-default-fg-color: #ece9e1d6; - --md-default-fg-color--light: #ece9e194; - --md-default-fg-color--lighter: #ece9e152; - --md-default-fg-color--lightest: #ece9e11f; - --md-default-bg-color: #16182a; - --md-default-bg-color--light: #16182a8a; - --md-default-bg-color--lighter: #16182a42; - --md-default-bg-color--lightest: #16182a12; - --md-code-bg-color: #1f2237; - --md-code-bg-color--light: #1f2237e6; - --md-code-bg-color--lighter: #1f22378a; - --md-typeset-kbd-border-color: #16182a; - --md-footer-bg-color: #10121f; - --md-footer-bg-color--dark: #0b0d17; - --md-accent-fg-color: #aab5ff; - --md-accent-fg-color--transparent: #aab5ff1a; - --cl-button-bg: #1f2237; - --cl-button-line: #34385a; - --cl-button-line-hover: #565b80; - --cl-button-fg: #ece9e1; - --cl-button-primary-hover: #5465c9; -} - -[data-md-color-scheme="slate"][data-md-color-primary="indigo"] { - --md-typeset-a-color: #8e9cf5; -} - -[data-md-color-scheme="slate"] .md-header, -[data-md-color-scheme="slate"] .md-tabs { - background-color: #16182a; - color: #ece9e1; -} - -[data-md-color-scheme="slate"] .md-header { - border-bottom: 1px solid #2b2e45; -} - -[data-md-color-scheme="slate"] .md-tabs__link { - color: #b3b6c9; - opacity: 1; -} - -[data-md-color-scheme="slate"] .md-tabs__item--active .md-tabs__link, -[data-md-color-scheme="slate"] .md-tabs__link:hover { - color: #fff; -} - -[data-md-color-scheme="slate"] .md-tabs__item--active .md-tabs__link { - font-weight: 700; -} - -[data-md-color-scheme="slate"] .md-nav--primary .md-nav__title[for="__drawer"] { - background-color: #16182a; - color: #ece9e1; -} - -[data-md-color-scheme="slate"] .md-nav__source { - background-color: #10121f; -} - -@media screen and (min-width: 60em) { - [data-md-color-scheme="slate"] .md-search__form, - [data-md-color-scheme="slate"] .md-search__form:hover { - background-color: #1f2237; - border: 1px solid #2b2e45; - border-radius: 0.4rem; - } - - [data-md-color-scheme="slate"] .md-search__input::placeholder { - color: #9b9eb3; - } - - [data-md-color-scheme="slate"] .md-search__input + .md-search__icon { - color: #b3b6c9; - } -} diff --git a/docs/stylesheets/shared.css b/docs/stylesheets/shared.css index 04df9ca..be8b7e8 100644 --- a/docs/stylesheets/shared.css +++ b/docs/stylesheets/shared.css @@ -2,8 +2,117 @@ * Styles shared by the cpp-linter docs sites. Each site loads this file from * https://cpp-linter.github.io/stylesheets/shared.css before its own stylesheet, * so rules that only one site needs belong in that site's stylesheet instead. + * + * It carries the look of the home page (paper and ink colors, a light header, and + * its fonts), so every docs site matches the hub without a template of its own. + * The fonts are declared here for that reason; a MkDocs site can set + * `theme.font: false` so Material stops loading Roboto from Google Fonts. */ +/* + * Fonts, self-hosted in docs/fonts under the SIL Open Font License 1.1 (see the + * OFL-*.txt files there): Instrument Sans for text, Bricolage Grotesque for + * headings and JetBrains Mono for code. The URLs are relative to this file, so a + * docs site that loads it from cpp-linter.github.io gets the fonts from there too. + * Only the latin and latin-ext subsets are kept, as variable fonts; a browser + * downloads a file only when a page uses its characters. + */ +@font-face { + font-family: "Bricolage Grotesque"; + font-style: normal; + font-weight: 500 800; + font-stretch: 100%; + font-display: swap; + src: url("../fonts/bricolage-grotesque-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: "Bricolage Grotesque"; + font-style: normal; + font-weight: 500 800; + font-stretch: 100%; + font-display: swap; + src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: "Instrument Sans"; + font-style: normal; + font-weight: 400 700; + font-stretch: 100%; + font-display: swap; + src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: "Instrument Sans"; + font-style: normal; + font-weight: 400 700; + font-stretch: 100%; + font-display: swap; + src: url("../fonts/instrument-sans-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: "Instrument Sans"; + font-style: italic; + font-weight: 400 700; + font-stretch: 100%; + font-display: swap; + src: url("../fonts/instrument-sans-italic-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: "Instrument Sans"; + font-style: italic; + font-weight: 400 700; + font-stretch: 100%; + font-display: swap; + src: url("../fonts/instrument-sans-italic-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: "JetBrains Mono"; + font-style: normal; + font-weight: 400 700; + font-display: swap; + src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: "JetBrains Mono"; + font-style: normal; + font-weight: 400 700; + font-display: swap; + src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: "JetBrains Mono"; + font-style: italic; + font-weight: 400 700; + font-display: swap; + src: url("../fonts/jetbrains-mono-italic-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: "JetBrains Mono"; + font-style: italic; + font-weight: 400 700; + font-display: swap; + src: url("../fonts/jetbrains-mono-italic-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + th { background-color: var(--md-default-fg-color--lightest); } @@ -123,3 +232,218 @@ a.md-annotation__index { transform: scale(.95); } } + +/* Code block enhancements */ +.md-typeset pre > code { + border-radius: 0.5rem; +} + +/* Fonts: Instrument Sans for text, JetBrains Mono for code, Bricolage Grotesque for headings */ +:root { + --md-text-font: "Instrument Sans"; + --md-code-font: "JetBrains Mono"; +} + +.md-typeset h1, +.md-typeset h2, +.md-typeset h3, +.md-header__topic:first-child { + font-family: "Bricolage Grotesque", var(--md-text-font-family); + letter-spacing: -0.01em; +} + +.md-typeset h1 { + color: var(--md-default-fg-color); + font-weight: 760; +} + +.md-typeset h2, +.md-typeset h3 { + font-weight: 700; +} + +/* Buttons in the shape and colors of the home page buttons */ +.md-typeset .md-button { + padding: 0.6em 1.3em; + background-color: var(--cl-button-bg); + border: 1px solid var(--cl-button-line); + border-radius: 12px; + color: var(--cl-button-fg); + font-weight: 600; + transition: background-color 0.2s, border-color 0.2s; +} + +.md-typeset .md-button:focus, +.md-typeset .md-button:hover { + background-color: var(--cl-button-bg); + border-color: var(--cl-button-line-hover); + color: var(--cl-button-fg); +} + +.md-typeset .md-button--primary, +.md-typeset .md-button--primary:focus, +.md-typeset .md-button--primary:hover { + border-color: transparent; + color: #fff; +} + +.md-typeset .md-button--primary { + background-color: #4051b5; +} + +.md-typeset .md-button--primary:focus, +.md-typeset .md-button--primary:hover { + background-color: var(--cl-button-primary-hover); +} + +/* + * Light scheme: the paper, ink and light header of the home page. + */ +[data-md-color-scheme="default"] { + --md-default-fg-color: #171a2ede; + --md-default-fg-color--light: #171a2e8f; + --md-default-fg-color--lighter: #171a2e52; + --md-default-fg-color--lightest: #171a2e12; + --md-default-bg-color: #f7f5ef; + --md-code-bg-color: #eeeae0; + --md-code-bg-color--light: #eeeae0b3; + --md-code-bg-color--lighter: #eeeae04d; + --md-footer-bg-color: #171a2e; + --md-footer-bg-color--dark: #10131f; + --md-accent-fg-color: #2b3685; + --md-accent-fg-color--transparent: #2b36851a; + --cl-button-bg: #fff; + --cl-button-line: #d8d3c4; + --cl-button-line-hover: #bdb6a2; + --cl-button-fg: #171a2e; + --cl-button-primary-hover: #2b3685; +} + +[data-md-color-scheme="default"] .md-header, +[data-md-color-scheme="default"] .md-tabs { + background-color: #f7f5ef; + color: #171a2e; +} + +[data-md-color-scheme="default"] .md-header { + border-bottom: 1px solid #e3dfd3; +} + +[data-md-color-scheme="default"] .md-tabs__link { + color: #454a63; + opacity: 1; +} + +[data-md-color-scheme="default"] .md-tabs__item--active .md-tabs__link, +[data-md-color-scheme="default"] .md-tabs__link:hover { + color: #171a2e; +} + +[data-md-color-scheme="default"] .md-tabs__item--active .md-tabs__link { + font-weight: 700; +} + +[data-md-color-scheme="default"] .md-nav--primary .md-nav__title[for="__drawer"] { + background-color: #f7f5ef; + color: #171a2e; +} + +[data-md-color-scheme="default"] .md-nav__source { + background-color: #171a2e; +} + +@media screen and (min-width: 60em) { + [data-md-color-scheme="default"] .md-search__form, + [data-md-color-scheme="default"] .md-search__form:hover { + background-color: #fff; + border: 1px solid #d8d3c4; + border-radius: 0.4rem; + } + + [data-md-color-scheme="default"] .md-search__input::placeholder { + color: #62677f; + } + + [data-md-color-scheme="default"] .md-search__input + .md-search__icon { + color: #454a63; + } +} + +/* Dark scheme: the same layout in the ink tones of the home page */ +[data-md-color-scheme="slate"] { + --md-default-fg-color: #ece9e1d6; + --md-default-fg-color--light: #ece9e194; + --md-default-fg-color--lighter: #ece9e152; + --md-default-fg-color--lightest: #ece9e11f; + --md-default-bg-color: #16182a; + --md-default-bg-color--light: #16182a8a; + --md-default-bg-color--lighter: #16182a42; + --md-default-bg-color--lightest: #16182a12; + --md-code-bg-color: #1f2237; + --md-code-bg-color--light: #1f2237e6; + --md-code-bg-color--lighter: #1f22378a; + --md-typeset-kbd-border-color: #16182a; + --md-footer-bg-color: #10121f; + --md-footer-bg-color--dark: #0b0d17; + --md-accent-fg-color: #aab5ff; + --md-accent-fg-color--transparent: #aab5ff1a; + --cl-button-bg: #1f2237; + --cl-button-line: #34385a; + --cl-button-line-hover: #565b80; + --cl-button-fg: #ece9e1; + --cl-button-primary-hover: #5465c9; +} + +[data-md-color-scheme="slate"][data-md-color-primary="indigo"] { + --md-typeset-a-color: #8e9cf5; +} + +[data-md-color-scheme="slate"] .md-header, +[data-md-color-scheme="slate"] .md-tabs { + background-color: #16182a; + color: #ece9e1; +} + +[data-md-color-scheme="slate"] .md-header { + border-bottom: 1px solid #2b2e45; +} + +[data-md-color-scheme="slate"] .md-tabs__link { + color: #b3b6c9; + opacity: 1; +} + +[data-md-color-scheme="slate"] .md-tabs__item--active .md-tabs__link, +[data-md-color-scheme="slate"] .md-tabs__link:hover { + color: #fff; +} + +[data-md-color-scheme="slate"] .md-tabs__item--active .md-tabs__link { + font-weight: 700; +} + +[data-md-color-scheme="slate"] .md-nav--primary .md-nav__title[for="__drawer"] { + background-color: #16182a; + color: #ece9e1; +} + +[data-md-color-scheme="slate"] .md-nav__source { + background-color: #10121f; +} + +@media screen and (min-width: 60em) { + [data-md-color-scheme="slate"] .md-search__form, + [data-md-color-scheme="slate"] .md-search__form:hover { + background-color: #1f2237; + border: 1px solid #2b2e45; + border-radius: 0.4rem; + } + + [data-md-color-scheme="slate"] .md-search__input::placeholder { + color: #9b9eb3; + } + + [data-md-color-scheme="slate"] .md-search__input + .md-search__icon { + color: #b3b6c9; + } +}