GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: rename possibly confusing variable and CSS class · nodejs/node@8e033c3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api_assets
    • api.js
    • style.css
  • test/doctool
    • test-doctool-html.mjs
  • tools/doc
    • buildCSSForFlavoredJS.mjs
    • html.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api_assets/api.js‎

Copy file name to clipboardExpand all lines: doc/api_assets/api.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@
142142
button.addEventListener('click', (el) => {
143143
const parentNode = el.target.parentNode;
144144

145-
const flavorSelector = parentNode.querySelector('.js-flavor-selector');
145+
const flavorToggle = parentNode.querySelector('.js-flavor-toggle');
146146

147147
let code = '';
148148

149-
if (flavorSelector) {
150-
if (flavorSelector.checked) {
149+
if (flavorToggle) {
150+
if (flavorToggle.checked) {
151151
code = parentNode.querySelector('.mjs').textContent;
152152
} else {
153153
code = parentNode.querySelector('.cjs').textContent;
Collapse file

‎doc/api_assets/style.css‎

Copy file name to clipboardExpand all lines: doc/api_assets/style.css
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ kbd {
950950
display: block;
951951
}
952952

953-
.js-flavor-selector {
953+
.js-flavor-toggle {
954954
-webkit-appearance: none;
955955
appearance: none;
956956
float: right;
@@ -963,14 +963,14 @@ kbd {
963963
cursor: pointer;
964964
margin: 0;
965965
}
966-
.js-flavor-selector:checked {
966+
.js-flavor-toggle:checked {
967967
background-image: url(./js-flavor-esm.svg);
968968
}
969-
.js-flavor-selector:not(:checked) ~ .mjs,
970-
.js-flavor-selector:checked ~ .cjs {
969+
.js-flavor-toggle:not(:checked) ~ .mjs,
970+
.js-flavor-toggle:checked ~ .cjs {
971971
display: none;
972972
}
973-
.dark-mode .js-flavor-selector {
973+
.dark-mode .js-flavor-toggle {
974974
filter: invert(1);
975975
}
976976

@@ -1001,7 +1001,7 @@ kbd {
10011001
}
10021002

10031003
@supports (aspect-ratio: 1 / 1) {
1004-
.js-flavor-selector {
1004+
.js-flavor-toggle {
10051005
height: 1.5em;
10061006
width: auto;
10071007
aspect-ratio: 2719 / 384;
@@ -1058,24 +1058,24 @@ kbd {
10581058
#apicontent {
10591059
overflow: hidden;
10601060
}
1061-
.js-flavor-selector {
1061+
.js-flavor-toggle {
10621062
display: none;
10631063
}
1064-
.js-flavor-selector + * {
1064+
.js-flavor-toggle + * {
10651065
margin-bottom: 2rem;
10661066
padding-bottom: 2rem;
10671067
border-bottom: 1px solid var(--color-text-primary);
10681068
}
1069-
.js-flavor-selector ~ * {
1069+
.js-flavor-toggle ~ * {
10701070
display: block !important;
10711071
background-position: top right;
10721072
background-size: 142px 20px;
10731073
background-repeat: no-repeat;
10741074
}
1075-
.js-flavor-selector ~ .cjs {
1075+
.js-flavor-toggle ~ .cjs {
10761076
background-image: url(./js-flavor-cjs.svg);
10771077
}
1078-
.js-flavor-selector ~ .mjs {
1078+
.js-flavor-toggle ~ .mjs {
10791079
background-image: url(./js-flavor-esm.svg);
10801080
}
10811081
}
Collapse file

‎test/doctool/test-doctool-html.mjs‎

Copy file name to clipboardExpand all lines: test/doctool/test-doctool-html.mjs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ const testData = [
138138
},
139139
{
140140
file: fixtures.path('document_with_esm_and_cjs_code_snippet.md'),
141-
html: '<input class="js-flavor-selector" type="checkbox" checked',
141+
html: '<input class="js-flavor-toggle" type="checkbox" checked',
142142
},
143143
{
144144
file: fixtures.path('document_with_cjs_and_esm_code_snippet.md'),
145-
html: '<input class="js-flavor-selector" type="checkbox" aria-label',
145+
html: '<input class="js-flavor-toggle" type="checkbox" aria-label',
146146
},
147147
];
148148

Collapse file

‎tools/doc/buildCSSForFlavoredJS.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/buildCSSForFlavoredJS.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function buildCSSForFlavoredJS(dynamicSizes) {
4545
`@media(max-width:${getMarginLeft(charCount) + getPaddingLeft(charCount) +
4646
charCount * ESTIMATED_CHAR_WIDTH + TOGGLE_WIDTH +
4747
getPaddingRight(charCount) + getMarginRight(charCount)}px){` +
48-
`.with-${charCount}-chars>.js-flavor-selector{` +
48+
`.with-${charCount}-chars>.js-flavor-toggle{` +
4949
'float:none;' +
5050
'margin:0 0 1em auto;' +
5151
'}' +
Collapse file

‎tools/doc/html.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/html.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export function preprocessElements({ filename }) {
250250
const actualCharCount = Math.max(charCountFirstTwoLines, previousNode.charCountFirstTwoLines);
251251
(dynamicSizes[filename] ??= new Set()).add(actualCharCount);
252252
node.value = `<pre class="with-${actualCharCount}-chars">` +
253-
'<input class="js-flavor-selector" type="checkbox"' +
253+
'<input class="js-flavor-toggle" type="checkbox"' +
254254
// If CJS comes in second, ESM should display by default.
255255
(node.lang === 'cjs' ? ' checked' : '') +
256256
' aria-label="Show modern ES modules syntax">' +

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.