Browse Source
Fix `sass` and `style` fields in `@tabler/icons-webfont` and stop publishing SVG fonts (#1633)
pull/1635/head
Paweł Kuna
6 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
9 additions and
5 deletions
-
packages/icons-webfont/.build/utilities.mjs
-
packages/icons-webfont/package.json
|
|
|
@ -131,10 +131,14 @@ export async function generateFont(strokeName, type, DIR) { |
|
|
|
|
|
|
|
const fileName = `tabler-icons${type === 'outline' ? (strokeName !== '400' ? `-${strokeName}` : '') : `-${type}`}`; |
|
|
|
|
|
|
|
// Ensure dist/fonts directory exists
|
|
|
|
// Ensure the output directories exist
|
|
|
|
mkdirSync(path.join(DIR, 'dist/fonts'), { recursive: true }); |
|
|
|
mkdirSync(path.join(DIR, 'fonts'), { recursive: true }); |
|
|
|
|
|
|
|
writeFileSync(path.join(DIR, `dist/fonts/${fileName}.svg`), svgFontFileSource); // for debug
|
|
|
|
// The intermediate SVG font is kept for debugging only. It goes to `fonts/`
|
|
|
|
// (git-ignored, not published) because the CSS does not reference it and it
|
|
|
|
// would make up most of the package size.
|
|
|
|
writeFileSync(path.join(DIR, `fonts/${fileName}.svg`), svgFontFileSource); |
|
|
|
writeFileSync(path.join(DIR, `dist/fonts/${fileName}.ttf`), ttfFile); |
|
|
|
writeFileSync(path.join(DIR, `dist/fonts/${fileName}.woff`), woffFile); |
|
|
|
writeFileSync(path.join(DIR, `dist/fonts/${fileName}.woff2`), woff2File); |
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ |
|
|
|
"build:css:filled": "sass dist/tabler-icons-filled.scss dist/tabler-icons-filled.css --style expanded && sass dist/tabler-icons-filled.scss dist/tabler-icons-filled.min.css --style compressed", |
|
|
|
"build:css:outline": "sass dist/tabler-icons.scss dist/tabler-icons.css --style expanded --no-source-map && sass dist/tabler-icons.scss dist/tabler-icons.min.css --style compressed --no-source-map && sass dist/tabler-icons-200.scss dist/tabler-icons-200.css --style expanded --no-source-map && sass dist/tabler-icons-200.scss dist/tabler-icons-200.min.css --style compressed --no-source-map && sass dist/tabler-icons-300.scss dist/tabler-icons-300.css --style expanded --no-source-map && sass dist/tabler-icons-300.scss dist/tabler-icons-300.min.css --style compressed --no-source-map", |
|
|
|
"build:css:all": "sass dist/tabler-icons.scss dist/tabler-icons.css --style expanded --no-source-map && sass dist/tabler-icons.scss dist/tabler-icons.min.css --style compressed --no-source-map && sass dist/tabler-icons-200.scss dist/tabler-icons-200.css --style expanded --no-source-map && sass dist/tabler-icons-200.scss dist/tabler-icons-200.min.css --style compressed --no-source-map && sass dist/tabler-icons-300.scss dist/tabler-icons-300.css --style expanded --no-source-map && sass dist/tabler-icons-300.scss dist/tabler-icons-300.min.css --style compressed --no-source-map", |
|
|
|
"clean": "find dist -mindepth 1 -delete 2>/dev/null; rm -rf dist && rm -rf ./icons-outlined", |
|
|
|
"clean": "find dist -mindepth 1 -delete 2>/dev/null; rm -rf dist && rm -rf ./icons-outlined ./fonts", |
|
|
|
"copy": "pnpm run copy:license", |
|
|
|
"copy:license": "cp ../../LICENSE ./LICENSE" |
|
|
|
}, |
|
|
|
@ -34,8 +34,8 @@ |
|
|
|
"files": [ |
|
|
|
"dist/*" |
|
|
|
], |
|
|
|
"sass": "./tabler-icons.scss", |
|
|
|
"style": "./tabler-icons.min.css", |
|
|
|
"sass": "./dist/tabler-icons.scss", |
|
|
|
"style": "./dist/tabler-icons.min.css", |
|
|
|
"keywords": [ |
|
|
|
"icons", |
|
|
|
"svg", |
|
|
|
|