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

SVG icons became black and badly sized and centered after gulp-svgmin update #6706

Closed
stephanegigandet opened this issue Apr 27, 2022 · 6 comments · Fixed by #6707
Closed
Assignees
Labels
🐛 bug This is a bug, not a feature request. 🥤 Gulp icons

Comments

@stephanegigandet
Copy link
Contributor

Describe the bug

On the current main branch (but not in the branch deployed on production), SVG icons are black and badly sized and centered:

image

To Reproduce

https://world.openfoodfacts.net/

Expected behavior

Icons should have the right color and be correctly sized and centered:

image

Screenshots

No response

Additional context

No response

Type of device

Browser

Browser version

No response

Number of products impacted

No response

Time per product

No response

@stephanegigandet stephanegigandet added the 🐛 bug This is a bug, not a feature request. label Apr 27, 2022
@stephanegigandet
Copy link
Contributor Author

stephanegigandet commented Apr 27, 2022

Before:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon" aria-hidden="true" focusable="false">

After:

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">

Maybe a recent update of svgmin.

@stephanegigandet
Copy link
Contributor Author

Probably due to this update: #6604

@stephanegigandet
Copy link
Contributor Author

These instructions seem to no longer work:

function icons() {
  return src("*.svg", { cwd: "./icons" }).
    pipe(
      svgmin({
      plugins: [
        {
          name: "removeViewBox",
          active: false
        },
        {
          name: "removeDimensions",
          active: true,
        },

@stephanegigandet stephanegigandet changed the title SVG icons recently became black and badly sized and centered SVG icons became black and badly sized and centered after gulp-svgmin update Apr 27, 2022
@stephanegigandet
Copy link
Contributor Author

All the svgo modules seem to now be ignored, even though the syntax looks correct.

@stephanegigandet
Copy link
Contributor Author

One thing we could do is to add 1 test to check that generated SVGs have a viewbox and don't have width and height.

@stephanegigandet
Copy link
Contributor Author

stephanegigandet commented Apr 27, 2022

Apparently it is a known issue since November 2021: ben-eb/gulp-svgmin#125

Good news: there seem to be workarounds :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug This is a bug, not a feature request. 🥤 Gulp icons
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants