Comments (5)
Hi @dugokontov,
your suggestion only works as long as all icons have the same dimensions — which doesn't need to be true (and in reality often is not). So there's no way to define a common dimension class.
In case all your icons have the same dimensions, feel free to suppress the generation of dimension classes and add the single dim
class in your own / custom stylesheet.
Cheers,
Joschi
from iconizr.
I think you didn't understand me. There will not be one .dims
class for all icons. There will be separate one for every icon in sprite. Let me expand example from above:
.icon-arrow,.icon-arrow\:regular{background-image:url('svg/icons.svg');background-position:0 0;background-repeat:no-repeat}
.icon-arrow.dims{width:22px;height:15px}
.icon-search,.icon-searc\:regular{background-image:url('svg/icons.svg');background-position:0 23px;background-repeat:no-repeat}
.icon-search.dims{width:12px;height:50px}
As you can see adding just .dim
class to any element will not do anything. So this will not apply any stile:
<div class="dims"></div>
For this div element to convert to any icon you have to add "icon" class, like this:
<div class="icon-arrow dims"></div>
and it will set width/height to 22px/15px. To display search icon create this html:
<div class="icon-search dims"></div>
and it will set width/height to 12px/50px.
I find this to be much cleaner than how it works now:
<div class="icon-search icon-search-dims"></div>
Not to say that it can easily produce errors on copy paste, where you apply dimensions from wrong icon, like this:
<div class="icon-search icon-arrow-dims"></div>
from iconizr.
Hi @dugokontov,
thanks for the explanation. I do understand your point now (and partly like the idea), although I don't fully agree with your statement that this is much cleaner. In fact, I see several possible implications:
- IMO, using the same class name for specifying the (individual) sizes of all icons somehow suggests that they all have the same size. I don't mind using more verbose — and more meaningful — class names.
- The support for chained CSS class names is pretty good but not identical to separate classes. Also, I don't have any insights about the support on the various mobile platforms.
- I'm not sure about the specificity implications of the chained classes. What happens when you define additional properties for the
dims
class? This might be a feature, but also a problem ...
Anyway, I see your point and I understand that this might come in handy in certain situations. Having said this, I recommend you to have an eye on the Node respectively Grunt based version of iconizr, which feature Mustache template based output rendering. Possibly you can achieve your proposal by modifying the output templates appropriately. Additionally, I might consider adding a switch to control the dimension class names in one of the next releases. Given that you posted this to the original PHP based version of iconizr, I must draw your attention to the fact that this is the most outdated version. I plan to improve it and move it to the same level as the Node / Grunt based versions someday, but please don't expect this to be in the nearest future.
Cheers,
Joschi
from iconizr.
Ok, thanks for the info.
I used this repo since this is the link you provided in footer of http://iconizr.com/ webpage: "You may report any issue there as well"
from iconizr.
@dugokontov thanks! Yes, unfortunately the iconizr.com website along with the PHP version of iconizr (which the website is based on) is rather outdated and I just can't find the time to work on either of them :(
from iconizr.
Related Issues (20)
- Add support for LESS output HOT 2
- Generator is stuck HOT 2
- Support for generic image sprites and not just SVG HOT 1
- Redundant data when using SVGs at multiple sizes HOT 1
- Web version ignores dim class opt-out
- Add support for Stylus output
- Confusing usage of SCSS version HOT 3
- Publish latest release to npm HOT 1
- Flood of process HOT 1
- Icons come out broken HOT 1
- Cant remove dimension classes HOT 2
- Calling svgo HOT 1
- Animated pseudo effects? HOT 1
- PNG sprite isn't being created HOT 8
- Web version fails when your SVG has a "fill" HOT 2
- Default icon height don't work
- Hi there HOT 1
- Negative countdown HOT 2
- SVG2 (SVG 1.3) incompatible.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iconizr.