Skip to content

Commit 341cd61

Browse files
authored
Feature/dark mode (#1625)
* first adjustments to dark mode * more dark mode * turn on os-preferred dark-or-light mode * more dark mode tweaks (with @cwickham) * more tweaks * make guide+smart state work well with dark mode * dark mode fixes * freeze update * more dark mode fixes. * padding for announcement * fix announcement banner color * axe fixes * announcement bar uniformity
1 parent 42ae0f3 commit 341cd61

File tree

20 files changed

+224
-24
lines changed

20 files changed

+224
-24
lines changed

_freeze/docs/gallery/index/execute-results/html.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"hash": "ae771c86aa2b44ae71e8d150036ac29b",
2+
"hash": "8c897a991921ed17e476af65eacfbb87",
33
"result": {
44
"engine": "knitr",
5-
"markdown": "---\npagetitle: \"Gallery\"\nformat:\n html:\n toc: false\nimage: articles/advanced-layout-pdf.png\nsearch: false\nexecute:\n echo: false\nlisting:\n - id: gallery\n template: gallery.ejs\n contents: gallery.yml\ndescription: |\n A gallery of example documents, websites, books, and presentations created with Quarto.\naliases:\n - /docs/dashboards/examples/index.html\n - /docs/dashboards/examples/\n---\n\n\n\n::: {#hero-banner .column-screen}\n::: {.grid .column-page}\n::: {.headline .g-col-lg-6 .g-col-12 .g-col-md-12}\n::: h1\nGallery\n:::\n\nQuarto can produce a wide variety of output formats. Here are some examples:\n\n- [Articles & Reports](#articles-reports)\n- [Presentations](#presentations)\n- [Dashboards](#dashboards)\n- [Websites](#websites)\n- [Books](#books)\n- [Interactive Docs](#interactive-docs)\n:::\n\n\n\n::: {.cell .g-col-lg-6 .g-col-12 .g-col-md-12}\n::: {.cell-output-display}\n\n```{=html}\n<div id=\"gallery-carousel\" class=\"carousel carousel-dark slide\" data-bs-ride=\"carousel\">\n<div class=\"carousel-indicators\">\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"0\" aria-label=\"Slide 1\" class=\"active\" aria-current=\"true\"></button>\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"1\" aria-label=\"Slide 2\"></button>\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"2\" aria-label=\"Slide 3\"></button>\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"3\" aria-label=\"Slide 4\"></button>\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"4\" aria-label=\"Slide 5\"></button>\n</div>\n<div class=\"carousel-inner\">\n<div class=\"carousel-item active\" data-bs-interval=\"5000\">\n<a href=\"#articles-reports\">\n<img src=\"articles/advanced-layout-pdf.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Articles and reports with Python and R</p>\n</div>\n</div>\n<div class=\"carousel-item\" data-bs-interval=\"5000\">\n<a href=\"#presentations\">\n<img src=\"presentations/presentations.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Create data-driven presentations</p>\n</div>\n</div>\n<div class=\"carousel-item\" data-bs-interval=\"5000\">\n<a href=\"#interactive-docs\">\n<img src=\"interactive/interactive-jupyter.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Engage readers with interactivity</p>\n</div>\n</div>\n<div class=\"carousel-item\" data-bs-interval=\"5000\">\n<a href=\"#websites\">\n<img src=\"websites/websites-quarto.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Publish collections of articles as a website</p>\n</div>\n</div>\n<div class=\"carousel-item\" data-bs-interval=\"5000\">\n<a href=\"#books\">\n<img src=\"websites/websites-jupyter.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Create multi-format books</p>\n</div>\n</div>\n</div>\n<button class=\"carousel-control-prev\" type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide=\"prev\">\n<span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n<span class=\"visually-hidden\">Prevoius</span>\n</button>\n<button class=\"carousel-control-next\" type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide=\"next\">\n<span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n<span class=\"visually-hidden\">Next</span>\n</button>\n</div>\n```\n\n:::\n:::\n\n\n:::\n:::\n\n::: {#gallery .column-page}\n:::\n\n\n\n```{=html}\n<style>\n\n#hero-banner {\n padding-top: 35px;\n background-color: rgb(237,243,249);\n}\n\n#quarto-content main { \n margin-top: 0;\n padding-top: 0;\n}\n\nhtml {\n scroll-behavior: smooth;\n}\n\n.headline {\n font-size: 1.25em;\n font-weight: 300;\n padding-bottom: 1em;\n}\n\n.headline p {\n margin: 0;\n padding-bottom: 0.2rem;\n}\n\n.headline a {\n text-decoration: none;\n}\n\n.headline ul li {\n margin-bottom: 0.3em;\n}\n\n.carousel.card {\n padding-top: 2em;\n}\n\n.carousel img {\n width: 70%;\n margin-bottom: 110px;\n}\n\n.carousel-control-prev-icon, .carousel-control-next-icon {\n margin-bottom: 110px;\n}\n\n.carousel-caption {\n padding-top: 1em;\n}\n\n.touch {\n \n}\n</style>\n```\n",
5+
"markdown": "---\npagetitle: \"Gallery\"\nformat:\n html:\n toc: false\nimage: articles/advanced-layout-pdf.png\nsearch: false\nexecute:\n echo: false\nlisting:\n - id: gallery\n template: gallery.ejs\n contents: gallery.yml\ndescription: |\n A gallery of example documents, websites, books, and presentations created with Quarto.\naliases:\n - /docs/dashboards/examples/index.html\n - /docs/dashboards/examples/\n---\n\n::: {#hero-banner .column-screen}\n::: {.grid .column-page}\n::: {.headline .g-col-lg-6 .g-col-12 .g-col-md-12}\n::: h1\nGallery\n:::\n\nQuarto can produce a wide variety of output formats. Here are some examples:\n\n- [Articles & Reports](#articles-reports)\n- [Presentations](#presentations)\n- [Dashboards](#dashboards)\n- [Websites](#websites)\n- [Books](#books)\n- [Interactive Docs](#interactive-docs)\n:::\n\n\n::: {.cell .g-col-lg-6 .g-col-12 .g-col-md-12}\n::: {.cell-output-display}\n\n```{=html}\n<div id=\"gallery-carousel\" class=\"carousel carousel-dark slide\" data-bs-ride=\"carousel\">\n<div class=\"carousel-indicators\">\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"0\" aria-label=\"Slide 1\" class=\"active\" aria-current=\"true\"></button>\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"1\" aria-label=\"Slide 2\"></button>\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"2\" aria-label=\"Slide 3\"></button>\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"3\" aria-label=\"Slide 4\"></button>\n<button type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide-to=\"4\" aria-label=\"Slide 5\"></button>\n</div>\n<div class=\"carousel-inner\">\n<div class=\"carousel-item active\" data-bs-interval=\"5000\">\n<a href=\"#articles-reports\">\n<img src=\"articles/advanced-layout-pdf.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Articles and reports with Python and R</p>\n</div>\n</div>\n<div class=\"carousel-item\" data-bs-interval=\"5000\">\n<a href=\"#presentations\">\n<img src=\"presentations/presentations.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Create data-driven presentations</p>\n</div>\n</div>\n<div class=\"carousel-item\" data-bs-interval=\"5000\">\n<a href=\"#interactive-docs\">\n<img src=\"interactive/interactive-jupyter.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Engage readers with interactivity</p>\n</div>\n</div>\n<div class=\"carousel-item\" data-bs-interval=\"5000\">\n<a href=\"#websites\">\n<img src=\"websites/websites-quarto.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Publish collections of articles as a website</p>\n</div>\n</div>\n<div class=\"carousel-item\" data-bs-interval=\"5000\">\n<a href=\"#books\">\n<img src=\"websites/websites-jupyter.png\" class=\"d-block mx-auto border\"/>\n</a>\n<div class=\"carousel-caption d-none d-md-block\">\n<p class=\"fw-light\">Create multi-format books</p>\n</div>\n</div>\n</div>\n<button class=\"carousel-control-prev\" type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide=\"prev\">\n<span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n<span class=\"visually-hidden\">Prevoius</span>\n</button>\n<button class=\"carousel-control-next\" type=\"button\" data-bs-target=\"#gallery-carousel\" data-bs-slide=\"next\">\n<span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n<span class=\"visually-hidden\">Next</span>\n</button>\n</div>\n```\n\n:::\n:::\n\n:::\n:::\n\n::: {#gallery .column-page}\n:::\n\n```{=html}\n<style>\n\n/* we need to hide this element */\n/* <header id=\"title-block-header\" class=\"quarto-title-block\"></header> */\n\nheader#title-block-header {\n display: none;\n}\n\nbody.quarto-light #hero-banner {\n background-color: rgb(240,245,249);\n}\n\nbody.quarto-dark #hero-banner {\n background-color: rgb(60,64,82);\n}\n\ndiv.carousel {\n margin-top: 2rem; \n}\n\nbody.quarto-dark .carousel-dark .carousel-indicators [data-bs-target] {\n background-color: rgb(255,255,255);\n}\n\nbody.quarto-dark .carousel-dark .carousel-control-next-icon,\nbody.quarto-dark .carousel-dark .carousel-control-prev-icon {\n filter: inherit;\n}\n\n#quarto-content main { \n margin-top: 0;\n padding-top: 0;\n}\n\nhtml {\n scroll-behavior: smooth;\n}\n\n.headline {\n font-size: 1.25em;\n font-weight: 300;\n padding-bottom: 1em;\n}\n\n.headline p {\n margin: 0;\n padding-bottom: 0.2rem;\n}\n\n.headline a {\n text-decoration: none;\n}\n\n.headline ul li {\n margin-bottom: 0.3em;\n}\n\n.carousel.card {\n padding-top: 2em;\n}\n\n.carousel img {\n width: 70%;\n margin-bottom: 110px;\n}\n\n.carousel-control-prev-icon, .carousel-control-next-icon {\n margin-bottom: 110px;\n}\n\n.carousel-caption {\n padding-top: 1em;\n}\n\n.touch {\n \n}\n</style>\n```\n",
66
"supporting": [],
77
"filters": [
88
"rmarkdown/pagebreak.lua"

_quarto.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ project:
1010
- "/docs/blog/posts/2024-07-02-beautiful-tables-in-typst/demo"
1111
- "/.well-known/atproto-did"
1212

13+
highlight-style: a11y
14+
1315
website:
1416
title: "Quarto"
1517
image: "quarto-dark-bg.jpeg"
@@ -663,9 +665,11 @@ bibliography: references.bib
663665

664666
format:
665667
html:
668+
respect-user-color-scheme: true
666669
toc: true
667670
theme:
668671
light: [cosmo, theme.scss]
672+
dark: [cosmo, theme-dark.scss]
669673
code-copy: true
670674
code-overflow: wrap
671675
css: styles.css

docs/blog/index.qmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ listing:
1010
feed: true
1111
page-layout: full
1212
margin-header: signup.html
13-
title-block-banner: "#EDF3F9"
14-
title-block-banner-color: body
13+
title-block-banner: true
1514
search: false
1615
image: quarto-blog-v2.png
1716
---

docs/blog/posts/_metadata.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ comments:
22
giscus:
33
repo: quarto-dev/quarto-cli
44
category: Blog
5-
title-block-banner: "#EDF3F9"
6-
title-block-banner-color: body
5+
title-block-banner: true
76
toc-location: left
87
format:
98
html:

docs/gallery/index.qmd

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,32 @@ carousel("gallery-carousel", 5000,
5151
```{=html}
5252
<style>
5353
54-
#hero-banner {
55-
padding-top: 35px;
56-
background-color: rgb(237,243,249);
54+
/* we need to hide this element */
55+
/* <header id="title-block-header" class="quarto-title-block"></header> */
56+
57+
header#title-block-header {
58+
display: none;
59+
}
60+
61+
body.quarto-light #hero-banner {
62+
background-color: rgb(240,245,249);
63+
}
64+
65+
body.quarto-dark #hero-banner {
66+
background-color: rgb(60,64,82);
67+
}
68+
69+
div.carousel {
70+
margin-top: 2rem;
71+
}
72+
73+
body.quarto-dark .carousel-dark .carousel-indicators [data-bs-target] {
74+
background-color: rgb(255,255,255);
75+
}
76+
77+
body.quarto-dark .carousel-dark .carousel-control-next-icon,
78+
body.quarto-dark .carousel-dark .carousel-control-prev-icon {
79+
filter: inherit;
5780
}
5881
5982
#quarto-content main {

docs/get-started/_redirect.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
<script type="text/javascript">
2+
/* This code exists but is no longer used in the "happy path" for our webpage. If someone lands here it
3+
will still work but redirect to the main guide, which itself will no longer use redirection.
4+
5+
The issue with redirection is it causes a FOUC
6+
27
const toolPage = window.localStorage.getItem("tutorialToolGetStarted") || "jupyter.html";
38
window.location.replace(toolPage);
49
</script>

docs/get-started/_tool-menu.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script type="text/javascript">
2+
// get file name
3+
const toolPage = window.location.pathname.split("/").slice(-1)[0] || window.localStorage.getItem("tutorialToolGetStarted") || "jupyter.html";
4+
// save in local storage
5+
window.localStorage.setItem("tutorialToolGetStarted", toolPage);
6+
7+
for (const node of document.querySelectorAll("li.sidebar-item a:has(span.menu-text)")) {
8+
if (node.href.endsWith("/")) {
9+
node.href = node.href + toolPage;
10+
}
11+
}
12+
</script>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include-before-body:
2+
- ../_tool-menu.html
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
# These pages exist but are no longer needed; they're there in case someone links to them
3+
# from the web
24
title: "Tutorial: Authoring"
35
include-in-header: ../_redirect.html
46
---
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include-before-body:
2+
- ../_tool-menu.html

0 commit comments

Comments
 (0)