Comments (3)
Just use SCSS.
Example:
# styles.scss
// import required files
@import '../node_modules/hover.css/scss/options';
@import '../node_modules/hover.css/scss/hacks';
@import '../node_modules/hover.css/scss/mixins';
// import just effects u need
@import '../node_modules/hover.css/scss/effects/2d-transitions/grow';
// Apply Hover to Element
a {
@include grow();
}
from hover.
From the documentation:
A. Copy and Paste an Effect
If you plan on only using one or several effects, it's better practice to copy and paste an effect into your own stylesheet, so a user doesn't have to download css/hover.css in its entirety.Assuming you want to use the Grow effect:
Download Hover.css
In css/hover.css, find the Grow CSS (each effect is named using a comment above it):
/* Grow */
.hvr-grow {
display: inline-block;
vertical-align: middle;
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
transition-duration: 0.3s;
transition-property: transform;
}.hvr-grow:hover,
.hvr-grow:focus,
.hvr-grow:active {
transform: scale(1.1);
}
Copy this effect and then paste it into your own stylesheet.In the HTML file which you'd like the effect to appear, add the class of .hvr-grow to your chosen element.
Example element before applying Hover.css effect:
Add to Basket
Example element after applying Hover.css effect:Add to Basket
Note: As of 2.0.0 all Hover.css class names are prefixed with hvr- to prevent conflicts with other libraries/stylesheets. If using Sass/LESS, this can easily be changed using the $nameSpace/@namespace variable in scss/_options.scss or less/_options.less.
from hover.
I know I can copy and paste code but that is not scalable. If I want to keep the CSS up to date when this project is updated I would have to redo the manual task again.
My proposal is to look into splitting the effects into components that can be pulled in projects individually. Using this approach, it would be simple to use this into React or AMP themes for example.
Have a look at this project https://bitsrc.io/features
Some examples here https://blog.bitsrc.io/the-vanilla-and-flavouring-pattern-fcf07942a57a
and https://blog.bitsrc.io/how-to-use-sass-and-css-modules-with-create-react-app-83fa8b805e5e
from hover.
Related Issues (20)
- Unable to pay for license HOT 2
- stay at the animated state HOT 1
- some transitions don't work (well) in IE and Edge HOT 2
- Please submit this to CDNjs HOT 1
- Transform property giving me issues on Opera
- How to get background effects on rounded elements? HOT 1
- problem with addMediaConversion HOT 5
- Border Radius Issue HOT 2
- The license HOT 1
- Css3
- Why it's called Bob effect HOT 2
- [Documentation] More explanations for some of the effects?
- [Feature suggestion] Limit hover-effects after n seconds HOT 1
- Hover issue on "hvr-bounce-to-right" animation with border and border-radius properties HOT 1
- Trying to make sense of the commercial vs. MIT licensing
- How to change background color on hvr-bounce-to-left transitions HOT 2
- Add some pictures in the README file!
- can this library be customized? , for example, the underline color can be changed to redcan this library be customized? .for example the underline color can be changed to red . If so, please tell me how to use it
- dark mode / light mode can be implemented
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 hover.