Skip to content

Commit dc5fe4b

Browse files
authored
Merge branch 'main' into unify-figure-shortcodes
2 parents faca829 + 43ca85d commit dc5fe4b

20 files changed

Lines changed: 372 additions & 50 deletions

File tree

.github/workflows/label-check.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
env:
1313
LABELS: ${{ join( github.event.pull_request.labels.*.name, ' ' ) }}
1414

15+
permissions: {}
16+
1517
jobs:
1618
check-type-label:
1719
name: ensure type label

.github/workflows/milestone-merged-prs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
jobs:
1111
milestone_pr:
1212
name: attach to PR
13+
if: github.event.pull_request.merged == true
14+
permissions:
15+
contents: read
16+
issues: write
17+
pull-requests: read
1318
runs-on: ubuntu-latest
1419
steps:
1520
- uses: scientific-python/attach-next-milestone-action@bc07be829f693829263e57d5e8489f4e57d3d420

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
6+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
77
hooks:
88
- id: check-added-large-files
99
- id: check-ast
@@ -19,14 +19,14 @@ repos:
1919
- id: trailing-whitespace
2020

2121
- repo: https://github.com/rbubley/mirrors-prettier
22-
rev: bc7af46104f0f5368b95878decf720f9f00c2559 # frozen: v3.4.2
22+
rev: 5ba47274f9b181bce26a5150a725577f3c336011 # frozen: v3.6.2
2323
hooks:
2424
- id: prettier
2525
types_or: [yaml, toml, markdown, css, scss, javascript, json]
2626
args: [--prose-wrap=preserve]
2727

2828
- repo: https://github.com/astral-sh/ruff-pre-commit
29-
rev: 73413df07b4ab0bf103ca1ae73c7cec5c0ace593 # frozen: v0.9.2
29+
rev: 9c89adb347f6b973f4905a4be0051eb2ecf85dea # frozen: v0.13.3
3030
hooks:
3131
- id: ruff
3232
args:
@@ -39,7 +39,7 @@ repos:
3939
- id: ruff-format
4040

4141
- repo: https://github.com/woodruffw/zizmor-pre-commit
42-
rev: 4dcc98ccce605605fd6d5202bf803a8c8bc34e8d # v1.1.1
42+
rev: v1.14.2 # v1.1.1
4343
hooks:
4444
- id: zizmor
4545

assets/icons/linkedin.svg

Lines changed: 1 addition & 0 deletions
Loading

assets/theme-css/footer.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@
3939
color: var(--spht-color-link-hover);
4040
}
4141

42+
.footer-item a.nav-external {
43+
white-space: nowrap;
44+
}
45+
46+
.footer-item a.nav-external::after {
47+
font: var(--fa-font-solid);
48+
content: "\f35d";
49+
font-size: 0.75em;
50+
margin-left: 0.3em;
51+
display: inline-block;
52+
}
53+
4254
.footer-actions {
4355
max-width: 25vw;
4456
margin: 1.25rem 1.563rem;

assets/theme-css/navbar.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
nav,
21
.navbar {
32
background: var(--pst-color-background);
43
position: sticky;
@@ -42,6 +41,15 @@ a.navbar-item:hover,
4241
text-decoration-thickness: max(3px, 0.1875rem, 0.12em);
4342
}
4443

44+
a.navbar-item.nav-external::after,
45+
.navbar-dropdown a.navbar-item.nav-external::after {
46+
font: var(--fa-font-solid);
47+
content: "\f35d";
48+
font-size: 0.75em;
49+
margin-left: 0.3em;
50+
display: inline-block;
51+
}
52+
4553
.navbar-burger {
4654
font-family: inherit;
4755
font-size: 1em;

assets/theme-css/pst/components/_breadcrumbs.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/**
22
* Breadcrumbs for parent pages meant for the article header
33
*/
4+
nav[aria-label="Breadcrumb"] {
5+
width: fit-content;
6+
}
7+
48
ul.bd-breadcrumbs {
59
list-style: none;
610
padding-left: 0;

assets/theme-css/pst/variables/_fonts.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ html {
3333

3434
// Font family
3535
// These are adapted from https://systemfontstack.com/ */
36-
--pst-font-family-base-system: -apple-system, "BlinkMacSystemFont",
37-
"Segoe UI", "Helvetica Neue", "Arial", sans-serif, "Apple Color Emoji",
38-
"Segoe UI Emoji", "Segoe UI Symbol";
39-
--pst-font-family-monospace-system: "SFMono-Regular", "Menlo", "Consolas",
40-
"Monaco", "Liberation Mono", "Lucida Console", monospace;
36+
--pst-font-family-base-system:
37+
-apple-system, "BlinkMacSystemFont", "Segoe UI", "Helvetica Neue", "Arial",
38+
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
39+
--pst-font-family-monospace-system:
40+
"SFMono-Regular", "Menlo", "Consolas", "Monaco", "Liberation Mono",
41+
"Lucida Console", monospace;
4142
--pst-font-family-base: var(--pst-font-family-base-system);
4243
--pst-font-family-heading: var(--pst-font-family-base-system);
4344
--pst-font-family-monospace: var(--pst-font-family-monospace-system);

assets/theme-css/sphinx-design/_dropdown.scss

Lines changed: 123 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,35 @@ details.sd-dropdown {
55
font-weight: 700;
66
// don't overlap the chevron
77
padding-right: 3em !important;
8-
-moz-user-select: none;
9-
-ms-user-select: none;
10-
-webkit-user-select: none;
118
user-select: none;
9+
display: inline-flex;
10+
justify-content: space-between;
11+
align-items: center;
12+
width: 100%;
13+
14+
.sd-summary-text {
15+
flex-grow: 1;
16+
line-height: 1.5;
17+
padding-right: 0.5rem;
18+
}
19+
20+
.sd-summary-state-marker {
21+
position: absolute;
22+
right: 1em;
23+
top: 50%;
24+
transform: translateY(-50%);
25+
pointer-events: none;
26+
display: inline-flex;
27+
align-items: center;
28+
justify-content: center;
29+
width: 0.75em;
30+
}
31+
32+
// The hover effect should only change opacity, not transform.
33+
// We are transforming the chevron elements instead, see below.
34+
&:hover .sd-summary-state-marker svg {
35+
opacity: 1;
36+
}
1237
}
1338

1439
&:hover {
@@ -54,7 +79,6 @@ details.sd-dropdown {
5479
summary:hover .sd-summary-up svg,
5580
summary:hover .sd-summary-down svg {
5681
opacity: 1;
57-
transform: scale(1.1);
5882
}
5983

6084
.sd-summary-up svg,
@@ -79,6 +103,61 @@ details.sd-dropdown {
79103
visibility: hidden;
80104
}
81105

106+
// Chevron transitions
107+
.sd-summary-chevron-right i,
108+
.sd-summary-chevron-down i {
109+
display: inline-block;
110+
transform-origin: center;
111+
opacity: 0.6;
112+
}
113+
114+
// The chevron rotation animations are applied to
115+
// the icon inside the dropdown title div
116+
&[open] > .sd-summary-title .sd-summary-chevron-right i {
117+
transform: rotate(90deg);
118+
animation: rotate-to-90 0.25s ease-in-out;
119+
}
120+
121+
&[open] > .sd-summary-title .sd-summary-chevron-down i {
122+
transform: rotate(-180deg);
123+
animation: rotate-to-negative-180 0.25s ease-in-out;
124+
}
125+
126+
&:not([open]) > .sd-summary-title .sd-summary-chevron-right i {
127+
transform: rotate(0deg);
128+
animation: rotate-to-0-from-90 0.25s ease-in-out;
129+
}
130+
131+
&:not([open]) > .sd-summary-title .sd-summary-chevron-down i {
132+
transform: rotate(0deg);
133+
animation: rotate-to-0-from-negative-180 0.25s ease-in-out;
134+
}
135+
136+
> .sd-summary-title:hover .sd-summary-chevron-right i,
137+
> .sd-summary-title:hover .sd-summary-chevron-down i {
138+
opacity: 1;
139+
}
140+
141+
// Combined transforms for each state with hover. These cover
142+
// the cases where the chevron is rotated, say, when the dropdown
143+
// is open or if the chevron starts rotated (e.g. in the down-up
144+
// state).
145+
&:not([open]) > .sd-summary-title:hover .sd-summary-chevron-right i {
146+
transform: scale(1.1);
147+
}
148+
149+
&:not([open]) > .sd-summary-title:hover .sd-summary-chevron-down i {
150+
transform: scale(1.1);
151+
}
152+
153+
&[open] > .sd-summary-title:hover .sd-summary-chevron-right i {
154+
transform: rotate(90deg) scale(1.1);
155+
}
156+
157+
&[open] > .sd-summary-title:hover .sd-summary-chevron-down i {
158+
transform: rotate(-180deg) scale(1.1);
159+
}
160+
82161
// Hide the card body border when not open
83162
&:not([open]).sd-card {
84163
border: none;
@@ -90,18 +169,10 @@ details.sd-dropdown {
90169

91170
// Transition animation
92171
&.sd-fade-in[open] summary ~ * {
93-
-moz-animation: sd-fade-in 0.5s ease-in-out;
94-
-webkit-animation: sd-fade-in 0.5s ease-in-out;
95172
animation: sd-fade-in 0.5s ease-in-out;
96173
}
97174

98175
&.sd-fade-in-slide-down[open] summary ~ * {
99-
-moz-animation:
100-
sd-fade-in 0.5s ease-in-out,
101-
sd-slide-down 0.5s ease-in-out;
102-
-webkit-animation:
103-
sd-fade-in 0.5s ease-in-out,
104-
sd-slide-down 0.5s ease-in-out;
105176
animation:
106177
sd-fade-in 0.5s ease-in-out,
107178
sd-slide-down 0.5s ease-in-out;
@@ -135,3 +206,43 @@ details.sd-dropdown {
135206
transform: translate(0, 0);
136207
}
137208
}
209+
210+
@keyframes rotate-to-90 {
211+
from {
212+
transform: rotate(0deg) scale(1.1);
213+
}
214+
to {
215+
transform: rotate(90deg) scale(1.1);
216+
}
217+
}
218+
219+
@keyframes rotate-to-0-from-90 {
220+
from {
221+
transform: rotate(90deg) scale(1.1);
222+
}
223+
to {
224+
transform: rotate(0deg) scale(1.1);
225+
}
226+
}
227+
228+
// TODO: These keyframes are disabled for now to maintain
229+
// parity with Sphinx Design upstream, which does not implement
230+
// the down-up chevron animation.
231+
232+
// @keyframes rotate-to-negative-180 {
233+
// from {
234+
// transform: rotate(0deg) scale(1.1);
235+
// }
236+
// to {
237+
// transform: rotate(-180deg) scale(1.1);
238+
// }
239+
// }
240+
241+
// @keyframes rotate-to-0-from-negative-180 {
242+
// from {
243+
// transform: rotate(-180deg) scale(1.1);
244+
// }
245+
// to {
246+
// transform: rotate(0deg) scale(1.1);
247+
// }
248+
// }

doc/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ params:
4141
url: /shortcodes/
4242
- title: Examples
4343
url: /examples/
44+
- title: Repository
45+
url: https://github.com/scientific-python/scientific-python-hugo-theme
46+
is_external: true
4447
- title: More
4548
sublinks:
4649
- title: Dropdown item
@@ -61,6 +64,8 @@ params:
6164
icon: discourse
6265
- link: https://discord.com/invite/vur45CbwMz
6366
icon: discord
67+
- link: https://linkedin.com/company/scientific-python
68+
icon: linkedin
6469

6570
quicklinks:
6671
column1:
@@ -70,9 +75,11 @@ params:
7075
link: /about/
7176
- text: Theme GitHub
7277
link: https://github.com/scientific-python/scientific-python-hugo-theme
78+
is_external: true
7379
column2:
7480
links:
7581
- text: Scientific Python Forum
7682
link: https://discuss.scientific-python.org
83+
is_external: true
7784
column3:
7885
links:

0 commit comments

Comments
 (0)