Giter Club home page Giter Club logo

Comments (11)

crowjonah avatar crowjonah commented on August 20, 2024

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.

crowjonah avatar crowjonah commented on August 20, 2024

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.

ullmark avatar ullmark commented on August 20, 2024

thanks! not looking for a quick fix though. Let's see if your pull gets accepted :)

from ucss.

crowjonah avatar crowjonah commented on August 20, 2024

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.

oyvindeh avatar oyvindeh commented on August 20, 2024

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.

ullmark avatar ullmark commented on August 20, 2024

@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.

oyvindeh avatar oyvindeh commented on August 20, 2024

I think this should work now :)

from ucss.

oyvindeh avatar oyvindeh commented on August 20, 2024

@ullmark could you please check if it parses bootstrap now?

from ucss.

ullmark avatar ullmark commented on August 20, 2024

@oyvindeh Yep, I'll take a look asap :)

from ucss.

ullmark avatar ullmark commented on August 20, 2024

@oyvindeh Yes, it seems to work. It doesn't crash anymore! shipit! ;-)

from ucss.

oyvindeh avatar oyvindeh commented on August 20, 2024

It's shipped! :)

from ucss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.