Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Rendering Issue with new Icons #14

Closed
codenprose opened this issue Apr 12, 2021 · 13 comments
Closed

Rendering Issue with new Icons #14

codenprose opened this issue Apr 12, 2021 · 13 comments
Assignees
Labels
awaiting feedback Streamline is waiting for user's comment bug Something isn't working

Comments

@codenprose
Copy link

Codepen Link

Old Icon vs New Icon

Screen Shot 2021-04-12 at 11 44 25 AM

@codenprose
Copy link
Author

It appears there's an issue with the path in the new icon? I followed the steps to properly download icons from the @streamlinehq/streamlinehq package but after upgrading, I'm having trouble changing the size of the svg. In the picture above, when changing the height from 24px to 16px, a good portion of the svg gets cutoff.

@cbrwizard cbrwizard self-assigned this Apr 13, 2021
@cbrwizard cbrwizard added bug Something isn't working todo In our internal todo list labels Apr 13, 2021
@cbrwizard
Copy link
Contributor

Hey, could you please check the steps described here https://github.com/webalys-hq/streamlinehq-npm#how-to-change-style-size-etc and check the example app as well https://github.com/webalys-hq/streamlinehq-npm/tree/master/docs/latest/example-app. There you will be able to find the way to change sizes of our SVGs.

Please respond if this resolves your issue

@cbrwizard cbrwizard added awaiting feedback Streamline is waiting for user's comment and removed bug Something isn't working labels Apr 20, 2021
@codenprose
Copy link
Author

Hi @cbrwizard unfortunately I'm still having trouble. I think the issue is that there are hard coded width and height attributes on the svg files.

Screen Shot 2021-04-21 at 5 22 25 PM

@cbrwizard
Copy link
Contributor

@dkh215 how are you importing the image? I've just updated the example app with an exact image you're trying to use where I reduce its size to 16px. Here is the final result, it doesn't get cut.

Screenshot 2021-04-22 at 13 28 28

@cbrwizard cbrwizard removed the todo In our internal todo list label Apr 22, 2021
@codenprose
Copy link
Author

@cbrwizard interesting... I'm importing from the exact same path. I wonder if it's a compatibility issue with vue-svg-loader 🤔 , will dig into this. So weird.

@cbrwizard
Copy link
Contributor

We're strongly considering wiping all height and width properties from our svgs and setting only viewBox instead (will do this for new icons packs at least). This should solve this issue. No ETA yet though as we're busy with releasing another feature right now

@Gratouille
Copy link

I've just installed the NPM packages and that's a big issue for me, because these height & width properties are killing the "responsiveness" of the SVG icons (with the hard coded #000 / currentColor issue there).

At this time I've added the [string-replace-loader](https://github.com/Va1/string-replace-loader), and I'm using it for deleting these parts before the file-loader parses them (as well as replacing any #000 or #000000 color code with currentColor). It works as intended, but it's quite a downgrade for me.

@codenprose
Copy link
Author

Looks vue-svg-loader removes viewbox attributes by default. I updated that setting and can now adjust the width and height by wrapping each svg in a div element and then targeting the svg. This unblocks me for now but it would be great if hard coded width and height attributes were eventually removed.

@cbrwizard cbrwizard added bug Something isn't working in progress In our internal in progress list and removed awaiting feedback Streamline is waiting for user's comment labels May 18, 2021
@cbrwizard
Copy link
Contributor

Proposed solution is to remove width and height params for all images and to set only viewbox param.

@cbrwizard cbrwizard mentioned this issue May 20, 2021
@pixel-glyph
Copy link

pixel-glyph commented May 22, 2021

Yup, setting a viewBox is the correct solution. I'm also running into this issue. Setting width and height directly on the SVG isn't necessary and without the correct viewBox defined, the SVG won't scale. Unfortunately, I'm also unable to set these imported icons as the src on an image tag. I'm following the example app, but the images are broken in the browser. I know it's not my SVG loader since I can import them and use them inline--I just can't scale them.

@cbrwizard
Copy link
Contributor

Width / height are going to be removed in the following release #23 and they will have viewBox only instead, so this issue will be fixed

@cbrwizard
Copy link
Contributor

We have recently recreated all assets and released a new NPM 3.0.1 version https://github.com/webalys-hq/streamlinehq-npm/releases/tag/3.0.1, please install it, fetch newest images and check if it helps you. Now width/height are removed, viewBox is added.

@cbrwizard cbrwizard added awaiting feedback Streamline is waiting for user's comment and removed in progress In our internal in progress list labels Jun 10, 2021
@cbrwizard
Copy link
Contributor

Closing this issue since I believe it's fixed. Feel free to respond if you think otherwise

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting feedback Streamline is waiting for user's comment bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants