@ -0,0 +1,58 @@ |
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const webfontsGenerator = require('webfonts-generator'); |
||||||
|
const path = require('path'); |
||||||
|
const fs = require('fs'); |
||||||
|
const glob = require("glob") |
||||||
|
|
||||||
|
const TEMPLATE_DIR = path.resolve(process.argv[2]); |
||||||
|
const CSS_FONT_URL = "../../../../../frontend/src/assets/fonts/openproject_icon/"; |
||||||
|
const FONT_DESTINATION = path.resolve(__dirname, '..', '..', '..', '..', '..', 'frontend', 'src', 'assets', 'fonts', 'openproject_icon'); |
||||||
|
|
||||||
|
const files = glob.sync(path.join(TEMPLATE_DIR, 'src/*.svg')); |
||||||
|
|
||||||
|
webfontsGenerator({ |
||||||
|
files, |
||||||
|
"fontName": "openproject-icon-font", |
||||||
|
"cssFontsUrl": CSS_FONT_URL, |
||||||
|
"dest": FONT_DESTINATION, |
||||||
|
"cssDest": path.join( |
||||||
|
path.resolve(__dirname, '..', 'styles', 'sass', 'common'), |
||||||
|
'icon.sass', |
||||||
|
), |
||||||
|
"cssTemplate": path.join(TEMPLATE_DIR, "icon.template.sass"), |
||||||
|
"types": ['woff2', 'woff'], |
||||||
|
"fixedWidth": true, |
||||||
|
"descent": 100 |
||||||
|
}, function(error) { |
||||||
|
if (error) { |
||||||
|
console.log('Failed to build icon font. ', error); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
webfontsGenerator({ |
||||||
|
files, |
||||||
|
"fontName": "openproject-icon-font", |
||||||
|
"cssFontsUrl": CSS_FONT_URL, |
||||||
|
"dest": FONT_DESTINATION, |
||||||
|
"cssDest": path.join( |
||||||
|
path.resolve(__dirname, '..', '..', '..', '..', '..', 'frontend', 'src', 'global_styles', 'fonts'), |
||||||
|
'_openproject_icon_definitions.sass', |
||||||
|
), |
||||||
|
"cssTemplate": path.join(TEMPLATE_DIR, "openproject-icon-font.template.sass"), |
||||||
|
"classPrefix": "icon-", |
||||||
|
"baseSelector": ".icon", |
||||||
|
"html": true, |
||||||
|
"htmlDest": path.join( |
||||||
|
path.resolve(__dirname, '..', '..', '..', '..', '..', 'frontend', 'src', 'global_styles', 'fonts'), |
||||||
|
'_openproject_icon_font.lsg', |
||||||
|
), |
||||||
|
"htmlTemplate": path.join(TEMPLATE_DIR, "openproject-icon-font.template.lsg"), |
||||||
|
"types": ['woff2', 'woff'], |
||||||
|
"fixedWidth": true, |
||||||
|
"descent": 100 |
||||||
|
}, function(error) { |
||||||
|
if (error) { |
||||||
|
console.log('Failed to build icon font. ', error); |
||||||
|
} |
||||||
|
}); |
@ -0,0 +1,28 @@ |
|||||||
|
.spot-icon |
||||||
|
display: inline-flex |
||||||
|
justify-content: center |
||||||
|
align-items: center |
||||||
|
|
||||||
|
&::before |
||||||
|
font-family: "openproject-icon-font" |
||||||
|
font-style: normal |
||||||
|
font-weight: normal |
||||||
|
font-variant: normal |
||||||
|
font-size: inherit |
||||||
|
text-transform: none |
||||||
|
text-decoration: none |
||||||
|
display: block |
||||||
|
speak: none |
||||||
|
line-height: 1 |
||||||
|
-webkit-font-smoothing: antialiased |
||||||
|
-moz-osx-font-smoothing: grayscale |
||||||
|
|
||||||
|
{{#each codepoints}} |
||||||
|
|
||||||
|
@mixin spot-icon-{{@key}} |
||||||
|
content: "\\{{this}}" |
||||||
|
|
||||||
|
.spot-icon_{{@key}}:before |
||||||
|
content: "\\{{this}}" |
||||||
|
|
||||||
|
{{/each}} |
@ -0,0 +1,9 @@ |
|||||||
|
{{#each codepoints}} |
||||||
|
|
||||||
|
@mixin icon-mixin-{{@key}} |
||||||
|
content: "\\{{this}}" |
||||||
|
|
||||||
|
.{{../classPrefix}}{{@key}}:before |
||||||
|
content: "\\{{this}}" |
||||||
|
|
||||||
|
{{/each}} |
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 678 B |
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 455 B |
Before Width: | Height: | Size: 129 B After Width: | Height: | Size: 129 B |
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 175 B |
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
Before Width: | Height: | Size: 273 B After Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 470 B |
Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 103 B After Width: | Height: | Size: 103 B |
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 135 B |
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 102 B After Width: | Height: | Size: 102 B |
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 610 B |
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 683 B After Width: | Height: | Size: 683 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 451 B |
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 341 B |
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 266 B |
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 153 B |
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 345 B After Width: | Height: | Size: 345 B |
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 149 B |
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 677 B After Width: | Height: | Size: 677 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 583 B After Width: | Height: | Size: 583 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 560 B After Width: | Height: | Size: 560 B |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 862 B |
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 564 B |
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 519 B After Width: | Height: | Size: 519 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 378 B |
Before Width: | Height: | Size: 376 B After Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 179 B |
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 527 B After Width: | Height: | Size: 527 B |
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 337 B |
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 662 B After Width: | Height: | Size: 662 B |
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 914 B |
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 914 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 899 B After Width: | Height: | Size: 899 B |