Skip to content

Commit f0b60c5

Browse files
akashyeoleaduh95
authored andcommitted
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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
1 parent 91cce27 commit f0b60c5

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
@@ -183,27 +183,32 @@ li.picker-header {
183183
position: relative;
184184
}
185185

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

209214
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)