-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split CSS files to make it possible to pick up individual effects [AMP Support] #143
Comments
From the documentation:
|
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 |
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();
} |
I really like this library and I want to use it with AMP see https://www.ampproject.org/
The problem
AMP validator limits the size of the CSS to 50kb.
The generated
hover.css
alone uses 115kb.Proposed solution
The ability to generate single CSS files for each effect.
This would make it possible for example, to import only the effects I want, i.e.
This library uses this approach https://github.com/basscss/addons
See https://github.com/ampproject/ampstart/blob/master/css/core.css
That makes it possible to use this library with AMP
The text was updated successfully, but these errors were encountered: