Skip to content

Commit dad5dc9

Browse files
authored
refactor: simplify the quartoorg site code (#2298)
* refactor: simplify the quartoorg site code The light and dark themes now share one announcement banner rule, and the prerelease banner only overrides its colour. The navbar drops a selector for an icon the site no longer uses. The page tweaks script detects macOS from the user agent instead of the deprecated navigator.platform, and marks pymd comments with a class instead of setting the font weight inline. * chore: remove unused images Two are backups of older renders that nothing ever referenced, and two are home page drafts from March 2023 that newer images replaced. * refactor: drop the scope on the pymd comment rule
1 parent 41f569a commit dad5dc9

12 files changed

Lines changed: 20 additions & 30 deletions

‎_extensions/quartoorg/assets/scripts/page-tweaks.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script type="text/javascript">
22

33
// replace cmd keyboard shortcut w/ control on non-Mac platforms
4-
const kPlatformMac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false;
4+
const kPlatformMac = /Macintosh/.test(navigator.userAgent);
55
if (!kPlatformMac) {
66
var kbds = document.querySelectorAll("kbd")
77
kbds.forEach(function(kbd) {
@@ -12,7 +12,7 @@
1212
// tweak headings in pymd
1313
document.querySelectorAll(".pymd span.co").forEach(el => {
1414
if (!el.innerText.startsWith("#|")) {
15-
el.style.fontWeight = 1000;
15+
el.classList.add("pymd-comment");
1616
}
1717
});
1818

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#quarto-announcement {
2+
padding: 1em;
3+
font-size: 1em;
4+
font-weight: bold;
5+
color: $white;
6+
background-color: #447099;
7+
}
8+
9+
#quarto-announcement a {
10+
color: $white;
11+
}

‎_extensions/quartoorg/scss/partials/_content.scss‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,9 @@ table.quarto-listing-table .listing-description a {
7070
pre.sourceCode.visually-hidden {
7171
overflow: hidden !important;
7272
}
73+
74+
/* page-tweaks.html marks the comments in .pymd blocks that are not
75+
`#|` cell options. */
76+
.pymd-comment {
77+
font-weight: 1000;
78+
}

‎_extensions/quartoorg/scss/partials/_dark-rules.scss‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,6 @@ details > summary {
9090
color: $text-muted;
9191
}
9292

93-
#quarto-announcement {
94-
padding: 1em;
95-
font-size: 1em;
96-
font-weight: bold;
97-
color: $white;
98-
background-color: #447099;
99-
}
100-
101-
#quarto-announcement a {
102-
color: $white;
103-
}
104-
10593
/*Footer Posit logo color for dark mode*/
10694

10795
img.footer-logo {

‎_extensions/quartoorg/scss/partials/_light-rules.scss‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,3 @@
3434
text-align: right;
3535
padding-right: 1em;
3636
}
37-
38-
#quarto-announcement {
39-
padding: 1em;
40-
font-size: 1em;
41-
font-weight: bold;
42-
color: $white;
43-
background-color: #447099;
44-
}
45-
46-
#quarto-announcement a {
47-
color: $white;
48-
}

‎_extensions/quartoorg/scss/partials/_navbar.scss‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
margin-left: .1em;
1919
}
2020

21-
.navbar .bi-twitter,
2221
.navbar .bi-github,
2322
.navbar .bi-rss
2423
{

‎_extensions/quartoorg/scss/partials/_site.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
@import "figures";
1313
@import "color-box";
1414
@import "home";
15+
@import "announcement";

‎_extensions/quartoorg/scss/prerelease-banner.scss‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
// #e60033 gives white text 4.76:1 (WCAG 1.4.3 needs 4.5:1).
55
// Cosmo's $danger (#ff0039) gives only 3.95:1.
66
#quarto-announcement {
7-
font-size: 1em;
8-
font-weight: bold;
9-
color: $white;
107
background-color: #e60033;
118
}

‎images/demo-jupyter.png‎

-251 KB
Binary file not shown.

‎images/hello-julia.bak2.png‎

-67.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)