Skip to content

Commit 788a544

Browse files
authored
Icons for zips and more (#4)
* Add table and zip icons * bump version
1 parent 48a8ba8 commit 788a544

10 files changed

Lines changed: 53 additions & 6 deletions

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@pierre/vscode-icons",
33
"displayName": "Pierre VS Code Icons",
44
"description": "File icon theme for VS Code backed by source SVGs.",
5-
"version": "0.0.5",
5+
"version": "0.0.6",
66
"publisher": "pierrecomputer",
77
"license": "MIT",
88
"type": "module",

scripts/build-icon-theme.mjs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,18 @@ function buildTheme(icons, { colored = false } = {}) {
8787
const lightFileExtensions = {};
8888
const fileNames = {};
8989
const lightFileNames = {};
90-
91-
for (const { name, color: iconColor, fileExtensions: exts, fileNames: names } of icons) {
90+
const folderNames = {};
91+
const lightFolderNames = {};
92+
const folderNamesExpanded = {};
93+
const lightFolderNamesExpanded = {};
94+
95+
for (const {
96+
name,
97+
color: iconColor,
98+
fileExtensions: exts,
99+
fileNames: names,
100+
folderNames: folders,
101+
} of icons) {
92102
const hasColor = colored && iconColor;
93103
const darkPath = hasColor ? `./${name}-color.svg` : `./${name}.svg`;
94104
const lightPath = hasColor ? `./${name}-color-light.svg` : `./${name}-light.svg`;
@@ -107,6 +117,14 @@ function buildTheme(icons, { colored = false } = {}) {
107117
lightFileNames[fn] = `${name}_light`;
108118
}
109119
}
120+
if (folders) {
121+
for (const fn of folders) {
122+
folderNames[fn] = name;
123+
lightFolderNames[fn] = `${name}_light`;
124+
folderNamesExpanded[fn] = name;
125+
lightFolderNamesExpanded[fn] = `${name}_light`;
126+
}
127+
}
110128
}
111129

112130
const hasSymlink = icons.some((i) => i.name === "file-symlink-duo");
@@ -132,6 +150,13 @@ function buildTheme(icons, { colored = false } = {}) {
132150
theme.light.fileNames = lightFileNames;
133151
}
134152

153+
if (Object.keys(folderNames).length > 0) {
154+
theme.folderNames = folderNames;
155+
theme.folderNamesExpanded = folderNamesExpanded;
156+
theme.light.folderNames = lightFolderNames;
157+
theme.light.folderNamesExpanded = lightFolderNamesExpanded;
158+
}
159+
135160
return theme;
136161
}
137162

scripts/themes/default.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ export default [
6363
name: "file-table-duo",
6464
fileExtensions: ["csv", "tsv", "xls", "xlsx", "ods"],
6565
},
66+
{
67+
name: "file-zip-duo",
68+
fileExtensions: ["zip", "tar", "gz", "tgz", "bz2", "xz", "7z", "rar", "jar", "war"],
69+
},
6670
{
6771
name: "font",
6872
fileExtensions: ["ttf", "otf", "woff", "woff2", "eot"],

svgs/file-table.svg

Lines changed: 3 additions & 0 deletions
Loading

svgs/file-text-duo.svg

Lines changed: 1 addition & 1 deletion
Loading

svgs/file-zip-duo.svg

Lines changed: 4 additions & 0 deletions
Loading

svgs/file-zip.svg

Lines changed: 4 additions & 0 deletions
Loading

svgs/folder-zip-duo.svg

Lines changed: 4 additions & 0 deletions
Loading

svgs/folder-zip.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)