Skip to content

Commit be7b414

Browse files
author
Akash Yeole
committed
doc,tools: replace bullet triangle with pure css design
Removed the hardcoded triangle from doc/template.html and tools/doc/html.mjs and placed the new <span> element which takes the shape of triangle using the new style defined in css.
1 parent 2839ea8 commit be7b414

File tree

3 files changed

+29
-26
lines changed

3 files changed

+29
-26
lines changed

doc/api_assets/style.css

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

185-
li.picker-header .collapsed-arrow, li.picker-header .expanded-arrow {
186-
position: relative;
187-
bottom: 0.2rem;
188-
width: 1.5ch;
189-
height: 1.5em;
190-
}
191-
192-
li.picker-header .collapsed-arrow {
193-
display: inline-block;
194-
}
195-
196-
li.picker-header .expanded-arrow {
197-
display: none;
198-
}
199-
200-
li.picker-header.expanded .collapsed-arrow,
201-
:root:not(.has-js) li.picker-header:hover .collapsed-arrow {
202-
display: none;
203-
}
204-
205-
li.picker-header.expanded .expanded-arrow,
206-
:root:not(.has-js) li.picker-header:hover .expanded-arrow {
185+
li.picker-header .picker-arrow {
207186
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;
208211
}
209212

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