Skip to content

Commit df664c1

Browse files
committed
icons [nfc]: Put directional-icons data in its own JSON file
1 parent e295420 commit df664c1

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
"arrow_right",
3+
"chevron_right",
4+
"send"
5+
]

tools/icons/build-icon-font.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,10 @@ async function main() {
6262
fs.copyFileSync(path.join(tmpDir, `${fontName}.ttf`), path.join(destDir, `${fontFileBaseName}.ttf`));
6363

6464
const template = fs.readFileSync(dataTemplateFile, 'utf8');
65-
// List of icons that should flip in RTL layouts
66-
const directionalIcons = [
67-
'arrow_right',
68-
'chevron_right',
69-
'send',
70-
];
65+
66+
// Icons that should flip horizontally in RTL layout.
67+
const directionalIconsFile = path.join(srcDir, 'directional_icons.json');
68+
const directionalIcons = fs.readFileSync(directionalIconsFile);
7169

7270
const generated = Object.entries(codepoints).map(([name, codepoint]) => {
7371
const codepointHex = "0x" + codepoint.toString(16);

0 commit comments

Comments
 (0)