Code Monkey home page Code Monkey logo

Comments (7)

bezoerb avatar bezoerb commented on July 18, 2024

Until now there is no way to ignore specific selectors but you can specify which css files to use.
As a workaround you could define the font in a separate css file and concat this after you applied critical.

from critical.

alanontheweb avatar alanontheweb commented on July 18, 2024

+1 for ignoring specific stylesheets. I specified which CSS file to use but it doesn't seem to be using that information to ignore the other...

from critical.

rupl avatar rupl commented on July 18, 2024

I think ignoring specific stylesheets is a big ask, and often people are concatenating everything together like @bezoerb said. Some sort of rule for excluding specific properties would be grand, e.g. exclude font-face blocks, anything with url as a value, etc.

My current workflow just includes a small test to scan the generated file for these problematic strings so I don't accidentally ship them.

from critical.

bezoerb avatar bezoerb commented on July 18, 2024

I've just released filter-css. A small module to filter out css rules.
We could add an ignore option to critical and use filter-css to remove the ignored rules from the critical css.

from critical.

oliverfarrell avatar oliverfarrell commented on July 18, 2024

+1 for this. Currently get some print media queries returned so would be useful to ignore specific media queries at the very least.

from critical.

bezoerb avatar bezoerb commented on July 18, 2024

@oliverfarrell wanna give it a try?

from critical.

bezoerb avatar bezoerb commented on July 18, 2024

Seems to work ;)
#88

from critical.

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.