Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-svg class #99

Open
saad-mo opened this issue May 22, 2017 · 1 comment
Open

no-svg class #99

saad-mo opened this issue May 22, 2017 · 1 comment

Comments

@saad-mo
Copy link

saad-mo commented May 22, 2017

Hello -

The generated CSS created a no-svg class by default.

.no-svg .hyicon:before { background-image: url("../icons.png"); }

is there a way to disable this as I have no need to use PNG fallback in my project.

@JamesNock
Copy link

I don't think there is... I've written a regex to remove the css after it's generated:

.pipe(replace(/\.no-svg \.svg-icon\:before\s{[^\r].*sprites\.png\"\);[^\r]}/g, ''))

I thought it might be useful as an aid for anyone else with this issue. My full gulp task is below for context:

var replace = require('gulp-string-replace');
gulp.task('svg:spritesheet:build', function() {
	return gulp.src('src/public/images/svg/*.svg')
        .pipe(svgSprite({
        	common: "svg-icon",
            cssFile: "../scss/sprites.scss",
            svg: { sprite: "../images/sprites.svg" },
            svgPath: '/images/sprites.svg',
            preview: false
        }))
        .pipe(replace(/\.no-svg \.svg-icon\:before\s{[^\r].*sprites\.png\"\);[^\r]}/g, ''))
        .pipe(gulp.dest("src/public/images/"));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants