Skip to content

Commit a1a9363

Browse files
committed
More accurately target sections that require alt hx styling
1 parent e173957 commit a1a9363

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

assets/css/_html.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@import "keyboard-shortcuts.css";
2626
@import "quick-switch.css";
2727
@import "autocomplete.css";
28-
@import "tooltips.css";
28+
@import "tooltips.css"; /* must remain below functions */
2929
@import "copy-button.css";
3030
@import "settings.css";
3131
@import "toast.css";

assets/css/content/functions.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
position: relative;
2626
}
2727

28+
/* !important used in order to beat main heading styles (which use #id selectors),
29+
in both HTML and ePub. */
2830
.content-inner .detail-header .signature {
2931
font-family: var(--monoFontFamily);
30-
font-size: 13px;
3132
font-weight: 700;
32-
line-height: 2em;
33-
margin: 0;
33+
font-size: 13px !important;
34+
line-height: 2em !important;
35+
margin: 0 !important;
3436
}
3537

3638
.content-inner .detail-header:hover a.detail-link,

assets/css/content/general.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,25 @@
7070
font-weight: 400;
7171
}
7272

73+
/* Headings
74+
Summary, Callbacks and Functions sections output h1 and h2,
75+
which we style as h2 and h3. */
76+
7377
.content-inner {
7478
& h1 {
7579
font-size: 2rem;
7680
margin-top: 1.75em;
7781
}
7882

7983
& h2,
80-
& #summary h1,
81-
& .details-list h1 {
84+
& :is(#summary, #callbacks, #functions) h1 {
8285
font-size: 1.75rem;
8386
margin-top: 1.5em;
87+
margin-bottom: 0.5em;
8488
}
8589

8690
& h3,
87-
& .summary h2 {
91+
& :is(#summary, #callbacks, #functions) h2 {
8892
font-size: 1.45rem;
8993
margin-top: 1.5em;
9094
margin-bottom: 0.5em;

assets/css/tooltips.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ as it has absolute positioning, so doesn't impact the layout and click events pa
3333
overflow: auto;
3434
}
3535

36+
/* !important used in order to beat main heading and functions signature styles. */
3637
.tooltip .tooltip-body .signature {
3738
min-width: 320px;
3839
width: 100%;
39-
line-height: 1em;
40-
margin: .75em 0;
40+
line-height: 1em !important;
41+
margin: .75em 0 !important;
4142
}
4243

4344
.tooltip .tooltip-body .detail-header {

0 commit comments

Comments
 (0)