Skip to content

Commit 27493a1

Browse files
authored
doc: fix arrow vertical alignment in HTML version
This commit fixes the alignment of the bullet points (green arrow) under 'Node.js <version> documentation' by drawing a triangle in CSS instead of using an ASCII char. PR-URL: #52193 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent 4d86020 commit 27493a1

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

doc/api_assets/style.css

+25-20
Original file line numberDiff line numberDiff line change
@@ -182,27 +182,32 @@ li.picker-header {
182182
position: relative;
183183
}
184184

185-
li.picker-header .collapsed-arrow, li.picker-header .expanded-arrow {
186-
width: 1.5ch;
187-
height: 1.5em;
188-
}
189-
190-
li.picker-header .collapsed-arrow {
191-
display: inline-block;
192-
}
193-
194-
li.picker-header .expanded-arrow {
195-
display: none;
196-
}
197-
198-
li.picker-header.expanded .collapsed-arrow,
199-
:root:not(.has-js) li.picker-header:hover .collapsed-arrow {
200-
display: none;
201-
}
202-
203-
li.picker-header.expanded .expanded-arrow,
204-
:root:not(.has-js) li.picker-header:hover .expanded-arrow {
185+
li.picker-header .picker-arrow {
205186
display: inline-block;
187+
width: .6rem;
188+
height: .6rem;
189+
border-top: .3rem solid transparent;
190+
border-bottom: .3rem solid transparent;
191+
border-left: .6rem solid var(--color-links);
192+
border-right: none;
193+
margin: 0 .2rem .05rem 0;
194+
}
195+
196+
li.picker-header a:focus .picker-arrow,
197+
li.picker-header a:active .picker-arrow,
198+
li.picker-header a:hover .picker-arrow {
199+
border-left: .6rem solid var(--white);
200+
}
201+
202+
li.picker-header.expanded a:focus .picker-arrow,
203+
li.picker-header.expanded a:active .picker-arrow,
204+
li.picker-header.expanded a:hover .picker-arrow,
205+
:root:not(.has-js) li.picker-header:hover .picker-arrow {
206+
border-top: .6rem solid var(--white);
207+
border-bottom: none;
208+
border-left: .35rem solid transparent;
209+
border-right: .35rem solid transparent;
210+
margin-bottom: 0;
206211
}
207212

208213
li.picker-header.expanded > a,

doc/template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h1>Node.js __VERSION__ documentation</h1>
6060
__ALTDOCS__
6161
<li class="picker-header">
6262
<a href="#">
63-
<span class="collapsed-arrow">&#x25ba;</span><span class="expanded-arrow">&#x25bc;</span>
63+
<span class="picker-arrow"></span>
6464
Options
6565
</a>
6666

tools/doc/html.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ function altDocs(filename, docCreated, versions) {
528528
return list ? `
529529
<li class="picker-header">
530530
<a href="#">
531-
<span class="collapsed-arrow">&#x25ba;</span><span class="expanded-arrow">&#x25bc;</span>
531+
<span class="picker-arrow"></span>
532532
Other versions
533533
</a>
534534
<div class="picker"><ol id="alt-docs">${list}</ol></div>
@@ -558,7 +558,7 @@ function gtocPicker(id) {
558558
return `
559559
<li class="picker-header">
560560
<a href="#">
561-
<span class="collapsed-arrow">&#x25ba;</span><span class="expanded-arrow">&#x25bc;</span>
561+
<span class="picker-arrow"></span>
562562
Index
563563
</a>
564564
@@ -575,7 +575,7 @@ function tocPicker(id, content) {
575575
return `
576576
<li class="picker-header">
577577
<a href="#">
578-
<span class="collapsed-arrow">&#x25ba;</span><span class="expanded-arrow">&#x25bc;</span>
578+
<span class="picker-arrow"></span>
579579
Table of contents
580580
</a>
581581

0 commit comments

Comments
 (0)