Skip to content

Commit 22af5bf

Browse files
authored
update anchor header styles (#42)
* update anchor header styles * update anchor with .discrete class * updates for step headers
1 parent c9d488c commit 22af5bf

File tree

2 files changed

+45
-37
lines changed

2 files changed

+45
-37
lines changed

src/css/doc.css

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,26 @@
114114
font-weight: var(--alt-heading-font-weight);
115115
}
116116

117+
.doc h2:not(.discrete),
118+
.doc h3:not(.discrete),
119+
.doc h4:not(.discrete),
120+
.doc h5:not(.discrete),
121+
.doc h6:not(.discrete) {
122+
display: flex;
123+
flex-direction: row-reverse;
124+
justify-content: flex-end;
125+
align-items: center;
126+
gap: var(--ds-space-h);
127+
}
128+
117129
.doc h1 .anchor,
118130
.doc h2 .anchor,
119131
.doc h3 .anchor,
120132
.doc h4 .anchor,
121133
.doc h5 .anchor,
122134
.doc h6 .anchor {
123-
position: absolute;
135+
display: flex;
124136
text-decoration: none;
125-
width: 2.75ex;
126-
margin-left: -2ex;
127137
visibility: hidden;
128138
font-weight: normal;
129139
color: var(--ds-primary-soft-hover-bg);
@@ -1003,19 +1013,13 @@
10031013
counter-reset: step;
10041014
}
10051015

1006-
.doc .step h2::before,
1007-
.doc .step h3::before,
1008-
.doc .step h4::before {
1016+
.doc .step h2::after,
1017+
.doc .step h3::after,
1018+
.doc .step h4::after {
10091019
counter-increment: step;
10101020
content: counter(step) ". ";
10111021
}
10121022

1013-
.doc .step h2 .anchor,
1014-
.doc .step h3 .anchor,
1015-
.doc .step h4 .anchor {
1016-
margin-left: -4.25ex;
1017-
}
1018-
10191023
.doc .conum[data-value] {
10201024
@include text-overline;
10211025

src/css/ds-layout.css

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,41 @@
1616
}
1717
}
1818

19-
html[data-layout="full"] main > .content {
20-
justify-content: center;
21-
}
19+
html[data-layout="full"] {
20+
main > .content {
21+
justify-content: center;
22+
}
2223

23-
html[data-layout="full"] .content-container {
24-
flex-wrap: wrap;
25-
align-content: center;
24+
.content-container {
25+
flex-wrap: wrap;
26+
align-content: center;
27+
}
2628
}
2729

28-
html[data-layout="landing"] .toolbar,
29-
html[data-layout="full"] .toolbar {
30-
justify-content: flex-end;
31-
}
30+
html[data-layout="landing"],
31+
html[data-layout="full"] {
32+
.toolbar {
33+
justify-content: flex-end;
34+
}
3235

33-
html[data-layout="landing"] .doc > h1.page:first-child,
34-
html[data-layout="full"] .doc > h1.page:first-child {
35-
font-size: calc(34 / var(--rem-base) * 1rem);
36-
margin-top: var(--ds-space-3);
37-
margin-top: var(--ds-space-2);
38-
}
36+
.doc > h1.page:first-child {
37+
font-size: calc(34 / var(--rem-base) * 1rem);
38+
margin-top: var(--ds-space-3);
39+
margin-top: var(--ds-space-2);
40+
}
3941

40-
html[data-layout="landing"] #preamble,
41-
html[data-layout="full"] #preamble {
42-
max-width: 650px;
43-
}
42+
#preamble {
43+
max-width: 650px;
44+
}
4445

45-
html[data-layout="landing"] .doc .olist li + li,
46-
html[data-layout="landing"] .doc .ulist li + li,
47-
html[data-layout="full"] .doc .olist li + li,
48-
html[data-layout="full"] .doc .ulist li + li {
49-
margin-top: var(--ds-space-2);
46+
.anchor {
47+
display: none;
48+
}
49+
50+
.doc .olist li + li,
51+
.doc .ulist li + li {
52+
margin-top: var(--ds-space-2);
53+
}
5054
}
5155

5256
.sect1.text-h1 {

0 commit comments

Comments
 (0)