Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

build: Add 'grunt-replace' & ensure sans-serif fallback in components SVGs #281

Merged
merged 1 commit into from Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 28 additions & 1 deletion Gruntfile.js
Expand Up @@ -28,6 +28,7 @@ module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-postcss' );
grunt.loadNpmTasks( 'grunt-replace' );
grunt.loadNpmTasks( 'grunt-sketch' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-svgmin' );
Expand Down Expand Up @@ -305,7 +306,7 @@ module.exports = function ( grunt ) {
plugins: [ {
cleanupIDs: false
}, {
removeDesc: false
removeDesc: true
}, {
removeRasterImages: true
}, {
Expand All @@ -331,6 +332,32 @@ module.exports = function ( grunt ) {
}
},

replace: {
dist: {
options: {
patterns: [
{
match: /Helvetica Neue"/g,
replacement: 'Helvetica Neue, sans-serif"'
},
{
match: /Lato"/g,
replacement: 'Lato, sans-serif"'
}
]
},
files: [ {
expand: true,
cwd: './',
src: [
'img/components/*.svg',
'resources/WikimediaUI-components_overview.svg'
],
dest: './'
} ]
}
},

// Development
watch: {
files: [
Expand Down
8 changes: 4 additions & 4 deletions img/components/button_groups_intro.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 25 additions & 25 deletions img/components/button_groups_states.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.