Skip to content

Commit 92f15b4

Browse files
committed
Switch to treating cheatsheet and admonition headings as the special cases
1 parent 0020833 commit 92f15b4

File tree

3 files changed

+43
-50
lines changed

3 files changed

+43
-50
lines changed

assets/css/content/cheatsheet.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/* h2 */
2424

2525
.page-cheatmd .content-inner h2 {
26+
font-size: 1.6rem;
2627
margin: var(--vertical-space) 0;
2728
column-span: all;
2829
color: var(--gray700);
@@ -36,6 +37,7 @@
3637
/* h3 */
3738

3839
.page-cheatmd .content-inner h3 {
40+
font-size: 1.375rem;
3941
margin: 0 0 1em;
4042
font-weight: 400;
4143
}
@@ -66,6 +68,7 @@
6668
/* h4 */
6769

6870
.page-cheatmd .content-inner h4 {
71+
font-size: 1rem;
6972
display: block;
7073
margin: 0;
7174
padding: 0.25em var(--horizontal-space);

assets/css/content/general.css

Lines changed: 39 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,6 @@
6262
color: var(--textHeaders);
6363
}
6464

65-
.content-inner h1 {
66-
font-size: 2em;
67-
margin: 0.5em 0;
68-
}
69-
70-
.content-inner h1.section-heading {
71-
margin: 1.5em 0 0.5em;
72-
}
73-
7465
.content-inner div.group-description {
7566
margin: 0 0 3em;
7667
}
@@ -79,51 +70,37 @@
7970
font-weight: 400;
8071
}
8172

82-
.content-inner h2 {
83-
font-size: 1.6em;
84-
margin-top: 1em;
85-
margin-bottom: 0.5em;
86-
}
87-
88-
.content-inner h3 {
89-
font-size: 1.375em;
90-
margin: 1em 0 0.5em;
91-
}
92-
93-
/* Apply more generous sizes and spacing to main/"top content" headings in order
94-
to differentiate between levels.
95-
Note: headings in various contexts, such as the module "Summary" section and
96-
cheatsheets, currently depend on previously-declared sizes and spacing. Here,
97-
we intend to target only headings of author content. At some point, we should
98-
probably make all heading styles more concrete/less dependent on the cascade
99-
so that more straightforward control is possible. */
73+
.content-inner {
74+
& h1 {
75+
font-size: 2rem;
76+
margin-top: 1.75em;
77+
}
10078

101-
:is(.page-module, .page-task, .page-extra) {
102-
& :is(#top-content, #moduledoc) {
103-
& > h2.section-heading {
104-
font-size: 1.75rem;
105-
margin-top: 1.75em;
106-
}
79+
& h2,
80+
& .summary h1 {
81+
font-size: 1.75rem;
82+
margin-top: 1.5em;
83+
}
10784

108-
& > h3.section-heading {
109-
font-size: 1.45rem;
110-
margin-top: 1.5em;
111-
margin-bottom: 0.5em;
112-
}
85+
& h3,
86+
& .summary h2 {
87+
font-size: 1.45rem;
88+
margin-top: 1.5em;
89+
margin-bottom: 0.5em;
90+
}
11391

114-
& > :is(h4, h5, h6) {
115-
font-size: 1.15rem;
116-
margin-top: 1.25em;
117-
margin-bottom: 0.5em;
118-
}
92+
& :is(h4, h5, h6) {
93+
font-size: 1.15rem;
94+
margin-top: 1.25em;
95+
margin-bottom: 0.5em;
96+
}
11997

120-
& > :is(h5, h6) {
121-
font-weight: normal;
122-
}
98+
& :is(h5, h6) {
99+
font-weight: normal;
100+
}
123101

124-
& > h6 {
125-
font-size: 1rem;
126-
}
102+
& h6 {
103+
font-size: 1rem;
127104
}
128105
}
129106

@@ -177,6 +154,18 @@ so that more straightforward control is possible. */
177154
overflow: auto;
178155
border-radius: var(--borderRadius-base);
179156

157+
& :is(h1, h2, h3, h4, h5, h6) {
158+
margin: 1.25rem 0;
159+
}
160+
161+
& :is(h1, h2, h3) {
162+
font-size: 1.375rem;
163+
}
164+
165+
& :is(h4, h5, h6) {
166+
font-size: 1rem;
167+
}
168+
180169
& :is(code, pre code) {
181170
background-color: var(--admCodeBackground);
182171
border: 1px solid var(--admCodeBorder);
@@ -188,7 +177,7 @@ so that more straightforward control is possible. */
188177
}
189178

190179
& :is(h1, h2, h3, h4, h5, h6):first-child {
191-
padding-bottom: 1em;
180+
padding-bottom: 1rem;
192181
border-bottom: 2px solid hsl(from currentColor h s l / 15%);
193182
}
194183

assets/css/tooltips.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ as it has absolute positioning, so doesn't impact the layout and click events pa
3737
min-width: 320px;
3838
width: 100%;
3939
line-height: 1em;
40+
margin: .75em 0;
4041
}
4142

4243
.tooltip .tooltip-body .detail-header {

0 commit comments

Comments
 (0)