Commit 84eaabd5 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] update inline-svg package and add more advanced SVG handling

parent 196166fd
......@@ -237,9 +237,17 @@ module.exports = class Css extends Task {
const svgFolderPath = this._getFullPath(this._config.directories.svg);
if (fs.existsSync(svgFolderPath)) {
const svgPartial = await new InlineSvg(
svgFolderPath,
path.join(svgFolderPath, '**'),
{
template: 'sgc-core/inline-svg-template.mustache'
template: 'sgc-core/inline-svg-template.mustache',
interceptor: (svgData) => {
return Object.assign(svgData, {
variableName: svgData.name.toLowerCase(),
prefix: this._config.css.svgIconPrefix
? this._config.css.svgIconPrefix
: ''
});
}
}
);
const partialFilePath = path.join(this._getFullPath(this._config.directories.sass), '_svg.scss');
......
......@@ -9,7 +9,7 @@
}
{{#svgs}}
${{{name}}}: "{{{inline}}}" {{width}} {{height}};
${{prefix}}{{{variableName}}}: "{{{inline}}}" {{width}} {{height}};
{{/svgs}}
@mixin inline-svg($name, $color: null) {
......
{
"name": "sgc",
"version": "3.0.4",
"version": "3.0.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -1692,11 +1692,13 @@
}
},
"@sgalinski/inline-svg": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@sgalinski/inline-svg/-/inline-svg-1.1.0.tgz",
"integrity": "sha512-glt16pAftf2DW8LmeLKKemFeRoBIPyI6EboFxazrPKOTF+wRTrl6XfblWlplR0woLwMZPNTyXhDKFmeeZuJqLQ==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@sgalinski/inline-svg/-/inline-svg-1.2.1.tgz",
"integrity": "sha512-qoq2zfuI3kcWaLNM5DCUF6SvPtREjkkQQ8fxad32Of1PQFjwnc8HDEADF2+JzIyb+P2eWkvms7ooJ4ssnppslQ==",
"requires": {
"globby": "^8.0.1",
"imagemin": "^6.0.0",
"imagemin-svgo": "^7.0.0",
"mini-svg-data-uri": "^1.0.1",
"mustache": "^2.3.2",
"underscore": "^1.9.1",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment