Comments (11)
As far as I can tell, this has to do with the @keyframe
syntax, along with its prefixed versions. It seems like it'd be safe to skip on optimizing these, similar to @font-face
.
Unfortunately, this appears to be a limitation of CSSOM, which is what ucss uses to parse the css. Here's an issue thread on the CSSOM repo that might point us in a useful direction.
from ucss.
If you're looking for a quick fix, you can (somewhat inefficiently) get ucss to ignore @(-vendorPrefixed-)keyframes by adding this conditional continue
in /lib/ucss.js
before _shake
tries to re_shake
around line 33:
if (rule.cssText.indexOf('keyframes') > -1) continue;
from ucss.
thanks! not looking for a quick fix though. Let's see if your pull gets accepted :)
from ucss.
It turns out that I initially misunderstood the way CSSOM parses keyframes, and as I've come to grasp it a little bit better, I've been able to come up with what I believe to be a more effective way of ignoring them in ucss. I suppose ideally we'd cross-check the name of the keyframes animation with the rest of the css to see if it gets used, but that might wind up adding a whole second pass to the processed output.
from ucss.
Hi guys! Sorry about the late response. I have tons of stuff to do at the moment, but I will hopefully be able to look into the pull request soon. Thanks for the patience!
Ps. Thanks a lot for making a Grunt task for uCSS!
from ucss.
@oyvindeh no worries, I think the uCSS part of the grunt task is more or less complete... (well depending on what you want it to do). I thought of extending its capabilities to also being able to clean away the unused css...
Doing it with regex might be a bit naive though... So, I thought about using CSSOM for that aswell..
from ucss.
I think this should work now :)
from ucss.
@ullmark could you please check if it parses bootstrap now?
from ucss.
@oyvindeh Yep, I'll take a look asap :)
from ucss.
@oyvindeh Yes, it seems to work. It doesn't crash anymore! shipit! ;-)
from ucss.
It's shipped! :)
from ucss.
Related Issues (20)
- More detailed output for unused rules
- Couldn't read dependencies HOT 2
- Follows links to binaries HOT 1
- Option for setting User agent header HOT 1
- Can’t run without config file HOT 3
- Stops unexpectedly without any error message
- Analyse CSS without any HTML page HOT 9
- HTML inside <script> HOT 1
- Does not crawl if config provided HOT 8
- Needs an option to crawl before and after login HOT 3
- Whether an array is empty or not should be judged by its length, not its self.
- Release v0.4.7 with the latest changes HOT 2
- npm install -g ucss installs a wrong version HOT 2
- possible EventEmitter memory leak HOT 5
- Wildcard in middle of exclude URL doesn't work HOT 2
- UCSS trying to fetch anchor URLs
- offtop: Do you know tool for converting obsolete html attributes to styles? HOT 2
- How does it find all unused css rules? HOT 1
- Dear oyvindeh
- Bug or outdated docs?
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 ucss.