stephenhutchings / typicons.font

336 pixel perfect, all-purpose vector icons in a web-font kit
https://www.s-ings.com/typicons
Other
1.42k stars 221 forks source link

remove height and width to provide font like behaviour. #8

Closed pywebdesign closed 3 years ago

pywebdesign commented 10 years ago

Width and Height property make typicons difficult to use in many situation. It should be left to the user to choose those styling rules. This way typicons uses the correct space and can be embeded easily in text.

stephenhutchings commented 10 years ago

I'm not sure this is a good idea but I'm open to debating it. My reservations are that this will render very differently for people already using Typicons and may break those sites. My initial use cases with Typicons also usually warranted these styles as I wanted to ensure all my icons took up the same space. However, other icon font stylesheets seem to work without the width and height being specified - with the styles also being applied to the root element, not the :before - and it would mean text-align: center; could also be removed. Just to note, the CSS is actually compiled by the make file in the repo, so I wouldn't be able to merge your adjustments.

pywebdesign commented 10 years ago

First I really like your icons. You are right that it would be a breaking change but I am confident that an good library is one that doesn't enforce it's way on user. I see it extremely differently than encouraging good convention.

At the beginning I saw your font not being render at the same height that the rest of the text and ask myself why. Then they take lots of place on right and left on my text and break the "flow". It took me quite a wile to make your font usable for my site because they were acting odd. it may be my fault tough but I really think icon should be placing itself like a letter so you can predict where it will render well or style it yourself with it's container.

I see your library not acting as i would think it would.

Maybe you could provide some kind of switch mechanism like a html class to make them "vanilla", without this styling. Other solution is to choose before a new major release of the font and maybe list it as a breaking change.

have a great day

stephenhutchings commented 10 years ago

I like your thinking and I think I'm convinced, but I will leave this open until I can work on a couple of updates. As you say, it makes sense to provide a utility class to make it a block element, and goes into my thinking of providing a few other utility classes for Typicons. I'll keep you updated on my progress.

stephenhutchings commented 3 years ago

The build scripts have been rewritten and the generated CSS no longer includes width or height attributes.