Skip to content

Commit

Permalink
Added SVG sprite generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Ledung committed Oct 2, 2015
1 parent 2a4d13a commit 0779d97
Show file tree
Hide file tree
Showing 87 changed files with 7,996 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
dist/
.idea/
1 change: 1 addition & 0 deletions dist/sb1-icons/symbol/sb1-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,733 changes: 4,733 additions & 0 deletions dist/sb1-icons/symbol/sprite.symbol.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/sfo-icons/symbol/sb1-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,021 changes: 2,021 additions & 0 deletions dist/sfo-icons/symbol/sprite.symbol.html

Large diffs are not rendered by default.

46 changes: 39 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
var gulp = require('gulp');
var concat = require('gulp-concat');
'use strict';

gulp.task('doc-gen', function() {
return gulp.src('icons/*')
.pipe(concat('index.html'))
.pipe(gulp.dest('dist'));
var gulp = require('gulp'),
svgSprite = require('gulp-svg-sprite'),
plumber = require('gulp-plumber'),
replace = require('gulp-replace'),
svgGlob = '**/*.svg',
config = {
"log": "info",
"svg": {
"dimensionAttributes": false
},
"shape": {
dimension : { // Dimension related options
maxWidth : 100, // Max. shape width
precision : 2, // Floating point precision
attributes : false // Width and height attributes on embedded shapes
}
},
"mode": {
symbol: {
sprite : "sb1-icons.svg",
example : true
}
},
"variables": {}
};

gulp.task('sb1-icons', function() {
return gulp.src(svgGlob, {cwd: 'icons'})
.pipe(plumber())
.pipe(svgSprite(config)).on('error', function(error){ console.log(error); })
.pipe(gulp.dest('dist/sb1-icons'))
});

gulp.task('default', ['doc-gen']);
gulp.task('sfo-icons', function() {
return gulp.src(svgGlob, {cwd: 'sfo-icons'})
.pipe(plumber())
.pipe(replace(' fill="#002776"', '')) // Remove royal-blue
.pipe(svgSprite(config)).on('error', function(error){ console.log(error); })
.pipe(gulp.dest('dist/sfo-icons'))
});
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ffe-icons",
"name": "sfo-icons",
"version": "1.0.0",
"description": "Felles Front End Icons",
"main": "index.js",
Expand All @@ -14,6 +14,9 @@
"license": "ISC",
"devDependencies": {
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0"
"gulp-concat": "^2.6.0",
"gulp-plumber": "^1.0.1",
"gulp-replace": "^0.5.4",
"gulp-svg-sprite": "^1.2.10"
}
}
15 changes: 15 additions & 0 deletions sfo-icons/arbeidsledighet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions sfo-icons/atv.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions sfo-icons/baat-liten.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions sfo-icons/baat-stor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions sfo-icons/barn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions sfo-icons/bekreft.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions sfo-icons/besoek.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions sfo-icons/betaling.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions sfo-icons/bil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions sfo-icons/bli-kunde.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions sfo-icons/bygg-anlegg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0779d97

Please sign in to comment.