IanLunn / Hover

A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.
http://ianlunn.github.io/Hover/
Other
29.25k stars 5.78k forks source link

Import just mixins, no generated classes? #37

Closed Jaspur closed 9 years ago

Jaspur commented 9 years ago

Is there an easy way to include just the mixins? When I include the hover.scss from bower, it also includes the generated classes for the hover-effect.

IanLunn commented 9 years ago

At the moment, no. I'll add a hover-mixins.scss file to a future version that just lists the mixins.

IanLunn commented 9 years ago

I changed my mind on adding this file as I don't think that many people will use it and it means another file to maintain. Is there a problem with using the predefined Hover classes? #4 has requested prefixed class names to reduce the chance of conflicts which will be addressed in the upcoming 2.0.

If you or anyone else wants to go ahead with this idea, the hover-mixins.scss file would look something like this:

@import "options";
@import "mixins";
@import "hacks";

@import "effects/grow";
@import "effects/shrink";
// Repeat for the other effects

Then you can add an effect's styles to your own class, like so:

.myclass {
    @include grow();
}
Jaspur commented 9 years ago

I don't use classes, only the @include for adding an effect. When including scss/hover.scssnow, and I wanna use two effects, I get all the classes, and is the css-file bigger then it has to be. I'll make a PR, then you can decide what you wanna do with it ;-)