Git Product home page Git Product logo

Comments (5)

djibe avatar djibe commented on May 26, 2024 1

True.
Netlify builds seems to crash randomly and not because of the plugin.
Thanks for your time.

from netlify-plugin-inline-critical-css.

Tom-Bonnike avatar Tom-Bonnike commented on May 26, 2024

Hi. Iā€™d need more info or an example site to understand the problem. critical already uses this media switching strategy for your non-inlined styles, you shouldn't have to implement it yourself? You may also need to know about netlify/build#1384.

from netlify-plugin-inline-critical-css.

djibe avatar djibe commented on May 26, 2024

Hi, thanks for your reply.

I don't use any Netlify optimization.

When I switch from
<link rel=stylesheet href=style.min.css
to
<link rel=stylesheet href=style.min.css media=print onload="this.media='all'"

plugin doesn't detect my stylesheet and therefore doesn't inline critical styles.

This <link rel=stylesheet href=style.min.css media=print onload="this.media='all'" is a smart way to defer CSS loading for performances.

Thanks for your time.

Best,

from netlify-plugin-inline-critical-css.

Tom-Bonnike avatar Tom-Bonnike commented on May 26, 2024

critical should be applying this strategy for your non-inlined styles already, you should double check, you may not need to do this yourself.

Iā€™m pretty sure critical will ignore media="print" stylesheets while parsing your HTML, see https://github.com/addyosmani/critical/blob/6b3e957ee2081dccb7113f23f4d648142687ef53/src/file.js#L376.

Closing, feel free to open an issue on https://github.com/addyosmani/critical if you think something is worth changing/fixing.

from netlify-plugin-inline-critical-css.

djibe avatar djibe commented on May 26, 2024

Sorry to be back.

Remade a commit with my stylesheet optimization only:
<link rel=stylesheet href=style.min.css media=print onload="this.media='all'">

Netlify sent me this:
(netlify-plugin-inline-critical-css onPostBuild completed in 6.5s)

The only <style> tag in my header was my @font-face declaration.

Reverted to
<link rel=stylesheet href=style.min.css>
and CSS inling is back.

from netlify-plugin-inline-critical-css.

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.