Skip to content

Commit 3f7bff1

Browse files
committed
docs(jump-links): improve non-contiguous demo
1 parent fbf2c6d commit 3f7bff1

File tree

1 file changed

+120
-93
lines changed

1 file changed

+120
-93
lines changed
Lines changed: 120 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,131 @@
1-
<article class="content">
2-
<section id="chapter-1">
3-
<h1>Chapter 1</h1>
4-
</section>
5-
<section id="chapter-2">
6-
<h2>
7-
<a href="#chapter-2">Chapter 2</a>
8-
</h2>
9-
</section>
10-
<section id="chapter-3">
11-
<h2>
12-
<a href="#chapter-3">Chapter 3</a>
13-
</h2>
14-
<section id="sub-chapter-1">
15-
<h3>
16-
<a href="#sub-chapter-1">Sub-chapter 3.1</a>
17-
</h3>
1+
<article>
2+
<div class="content">
3+
<section id="chapter-1">
4+
<h1>Chapter 1</h1>
185
</section>
19-
<section id="sub-chapter-2">
20-
<h3>
21-
<a href="#sub-chapter-2">Sub-chapter 3.2</a>
22-
</h3>
6+
<section id="chapter-2">
7+
<h2>
8+
<a href="#chapter-2">Chapter 2</a>
9+
</h2>
2310
</section>
24-
<section id="sub-chapter-3">
25-
<h3>
26-
<a href="#sub-chapter-3">Sub-chapter 3.3</a>
27-
</h3>
11+
<section id="chapter-3">
12+
<h2>
13+
<a href="#chapter-3">Chapter 3</a>
14+
</h2>
15+
<section id="sub-chapter-1">
16+
<h3>
17+
<a href="#sub-chapter-1">Sub-chapter 3.1</a>
18+
</h3>
19+
</section>
20+
<section id="sub-chapter-2">
21+
<h3>
22+
<a href="#sub-chapter-2">Sub-chapter 3.2</a>
23+
</h3>
24+
</section>
25+
<section id="sub-chapter-3">
26+
<h3>
27+
<a href="#sub-chapter-3">Sub-chapter 3.3</a>
28+
</h3>
29+
</section>
30+
<section id="sub-chapter-4">
31+
<h3>
32+
<a href="#sub-chapter-4">Sub-chapter 3.4</a>
33+
</h3>
34+
</section>
35+
<section id="sub-chapter-5">
36+
<h3>
37+
<a href="#sub-chapter-5">Sub-chapter 3.5</a>
38+
</h3>
39+
</section>
40+
<section id="sub-chapter-6">
41+
<h3>
42+
<a href="#sub-chapter-6">Sub-chapter 3.6</a>
43+
</h3>
44+
</section>
45+
<section id="sub-chapter-7">
46+
<h3>
47+
<a href="#sub-chapter-7">Sub-chapter 3.7</a>
48+
</h3>
49+
</section>
50+
<section id="sub-chapter-8">
51+
<h3>
52+
<a href="#sub-chapter-8">Sub-chapter 3.8</a>
53+
</h3>
54+
</section>
55+
<section id="sub-chapter-9">
56+
<h3>
57+
<a href="#sub-chapter-9">sub-chapter 3.9</a>
58+
</h3>
59+
</section>
60+
<section id="sub-chapter-10">
61+
<h3>
62+
<a href="#sub-chapter-10">Sub-chapter 3.10</a>
63+
</h3>
64+
</section>
2865
</section>
29-
<section id="sub-chapter-4">
30-
<h3>
31-
<a href="#sub-chapter-4">Sub-chapter 3.4</a>
32-
</h3>
66+
<section id="chapter-4">
67+
<h2>
68+
<a href="#chapter-4">Chapter 4</a>
69+
</h2>
3370
</section>
34-
<section id="sub-chapter-5">
35-
<h3>
36-
<a href="#sub-chapter-5">Sub-chapter 3.5</a>
37-
</h3>
71+
<section id="chapter-5">
72+
<h2>
73+
<a href="#chapter-5">Chapter 5</a>
74+
</h2>
75+
<section id="sub-chapter-11">
76+
<h3>
77+
<a href="#sub-chapter-11">Sub-chapter 5.1</a>
78+
</h3>
79+
</section>
80+
<section id="sub-chapter-12">
81+
<h3>
82+
<a href="#sub-chapter-12">Sub-chapter 5.2</a>
83+
</h3>
84+
</section>
3885
</section>
39-
<section id="sub-chapter-6">
40-
<h3>
41-
<a href="#sub-chapter-6">Sub-chapter 3.6</a>
42-
</h3>
43-
</section>
44-
<section id="sub-chapter-7">
45-
<h3>
46-
<a href="#sub-chapter-7">Sub-chapter 3.7</a>
47-
</h3>
48-
</section>
49-
<section id="sub-chapter-8">
50-
<h3>
51-
<a href="#sub-chapter-8">Sub-chapter 3.8</a>
52-
</h3>
53-
</section>
54-
<section id="sub-chapter-9">
55-
<h3>
56-
<a href="#sub-chapter-9">sub-chapter 3.9</a>
57-
</h3>
58-
</section>
59-
<section id="sub-chapter-10">
60-
<h3>
61-
<a href="#sub-chapter-10">Sub-chapter 3.10</a>
62-
</h3>
63-
</section>
64-
</section>
65-
<section id="chapter-4">
66-
<h2>
67-
<a href="#chapter-4">Chapter 4</a>
68-
</h2>
69-
</section>
70-
<section id="chapter-5">
71-
<h2>
72-
<a href="#chapter-5">Chapter 5</a>
73-
</h2>
74-
<section id="sub-chapter-11">
75-
<h3>
76-
<a href="#sub-chapter-11">Sub-chapter 5.1</a>
77-
</h3>
78-
</section>
79-
<section id="sub-chapter-12">
80-
<h3>
81-
<a href="#sub-chapter-12">Sub-chapter 5.2</a>
82-
</h3>
83-
</section>
84-
</section>
86+
</div>
87+
<pf-jump-links vertical>
88+
<pf-jump-links-item href="#sub-chapter-1">Sub-chapter 3.1</pf-jump-links-item>
89+
<pf-jump-links-item href="#sub-chapter-2">Sub-chapter 3.2</pf-jump-links-item>
90+
<pf-jump-links-item href="#sub-chapter-3">Sub-chapter 3.3</pf-jump-links-item>
91+
<pf-jump-links-item href="#sub-chapter-4">Sub-chapter 3.4</pf-jump-links-item>
92+
<pf-jump-links-item href="#sub-chapter-5">Sub-chapter 3.5</pf-jump-links-item>
93+
<pf-jump-links-item href="#sub-chapter-6">Sub-chapter 3.6</pf-jump-links-item>
94+
<pf-jump-links-item href="#sub-chapter-7">Sub-chapter 3.7</pf-jump-links-item>
95+
<pf-jump-links-item href="#sub-chapter-8">Sub-chapter 3.8</pf-jump-links-item>
96+
<pf-jump-links-item href="#sub-chapter-9">Sub-chapter 3.9</pf-jump-links-item>
97+
<pf-jump-links-item href="#sub-chapter-10">Sub-chapter 3.10</pf-jump-links-item>
98+
<pf-jump-links-item href="#sub-chapter-11">Sub-chapter 5.1</pf-jump-links-item>
99+
<pf-jump-links-item href="#sub-chapter-12">Sub-chapter 5.2</pf-jump-links-item>
100+
</pf-jump-links>
85101
</article>
86102

87-
<pf-jump-links vertical>
88-
<pf-jump-links-item href="#sub-chapter-1">Sub-chapter 3.1</pf-jump-links-item>
89-
<pf-jump-links-item href="#sub-chapter-2">Sub-chapter 3.2</pf-jump-links-item>
90-
<pf-jump-links-item href="#sub-chapter-3">Sub-chapter 3.3</pf-jump-links-item>
91-
<pf-jump-links-item href="#sub-chapter-4">Sub-chapter 3.4</pf-jump-links-item>
92-
<pf-jump-links-item href="#sub-chapter-5">Sub-chapter 3.5</pf-jump-links-item>
93-
<pf-jump-links-item href="#sub-chapter-6">Sub-chapter 3.6</pf-jump-links-item>
94-
<pf-jump-links-item href="#sub-chapter-7">Sub-chapter 3.7</pf-jump-links-item>
95-
<pf-jump-links-item href="#sub-chapter-8">Sub-chapter 3.8</pf-jump-links-item>
96-
<pf-jump-links-item href="#sub-chapter-9">Sub-chapter 3.9</pf-jump-links-item>
97-
<pf-jump-links-item href="#sub-chapter-10">Sub-chapter 3.10</pf-jump-links-item>
98-
<pf-jump-links-item href="#sub-chapter-11">Sub-chapter 5.1</pf-jump-links-item>
99-
<pf-jump-links-item href="#sub-chapter-12">Sub-chapter 5.2</pf-jump-links-item>
100-
</pf-jump-links>
101103

102104
<script type="module">
103105
import '@patternfly/elements/pf-jump-links/pf-jump-links.js';
104106
</script>
107+
108+
<style>
109+
article {
110+
display: grid;
111+
grid-template-columns: 1fr 0.25fr;
112+
gap: var(--pf-global--spacer--md, 1rem);
113+
}
114+
115+
.content {
116+
min-height: 100dvh;
117+
}
118+
119+
section {
120+
border: var(--pf-global--BorderWidth--sm, 1px) dashed var(--pf-global--BorderColor--100, #d2d2d2);
121+
margin-block-end: var(--pf-global--spacer--xs, 0.25rem);
122+
padding-block: var(--pf-global--spacer--2xl, 3rem) var(--pf-global--spacer--4xl, 6rem) ;
123+
padding-inline: var(--pf-global--spacer--md, 1rem);
124+
}
125+
126+
pf-jump-links {
127+
position: sticky;
128+
inset: 0;
129+
height: 100dvh;
130+
}
131+
</style>

0 commit comments

Comments
 (0)