Closed chriscalo closed 4 years ago
Hi @chriscalo, Thanks for your remarks and the recommendation for improvement! I'll take a look at this issue and get back to you ASAP.
Thanks, @therufa. Don't rush on my account. I have a simple enough workaround in place and just wanted to suggest an improvement.
It's probably worth thinking through the implications like:
Hi @chriscalo ,
I took your solution to the problem and added the styles you suggested to icons.css
. It should be available now in version 1.4.5 of the package.
Thanks for your contribution and your patience 😅
Thanks for the quick fix!
I just noticed that you added both CSS rules. From my brief testing a month ago, I think only one of the two is needed.
Related question: It appears the CSS isn't included by default. Is it a bad idea to apply these style fixes for all users of the library for any reason? I was thinking it might work to include a <style src="./path/to/icons.css"/>
in template.js
. Thoughts?
Say we have the following
<template>
:The icon renders roughly the following markup:
Unfortunately, the icon doesn't end up being 20×20 in size. It ends up slightly larger in height. The
<svg>
element has the correct dimensions, but the containing<span>
ends up being a little taller at23px
.It seems this is due to the
<svg>
defaulting todisplay: inline
andvertical-align: baseline
. This means when rendered in an inline layout context, the bottom edge of the<svg>
is lifted up until it aligns with the baseline of the line of text that it is on. In my opinion, this is almost never what you want for icons.I found two simple fixes that make this artifact go away:
or:
It seems reasonable that these icons should:
width
andheight
props.The CSS above seems to fix this, and it would be great if the icons had this styling by default so users wouldn't have to apply it themselves.
Thoughts?