Giter Club home page Giter Club logo

ct's Introduction

🧠 ct.css – Let’s take a look inside your <head>

Computed tomography of the head uses a series of X-rays in a CT scan of the head…
wikipedia.org/Computed_tomography_of_the_head

Your <head> is the single biggest render-blocking part of your page—ensuring it is well-formed is critical. ct.css is a diagnostic CSS snippet that exposes potential performance issues in your page’s <head> tags.

Example Output

  • Red: This is an error and should be addressed.
  • Orange: This could be problematic in certain scenarios.
  • Green: This is fine and is purely informational.
  • Solid: This file is the problem.
  • Dashed: Another file(s) are causing problems with this file.

Simple Usage

Paste this anywhere in your HTML:

<link rel="stylesheet" href="https://csswizardry.com/ct/ct.css" class="ct" />

Chrome Snippet

Run Snippets Of JavaScript On Any Page With Chrome DevTools

(function(){
  var ct = document.createElement('link');
  ct.rel = 'stylesheet';
  ct.href = 'https://csswizardry.com/ct/ct.css';
  ct.classList.add('ct');
  document.head.appendChild(ct);
}());

Limitations

  • Non-matching media types: Currently, ct.css only takes print stylesheets into account. This means that you may experience false-positives for other non-blocking stylesheets.
  • Injected script elements: ct.css, as with all CSS, acts against the DOM and not the HTML. As such, injected script elements will be falsely flagged as blocking.
    • Similarly, any script elements that are removed from the DOM will not be flagged.
  • Third-party blocking resources: The check for whether or not something is a third party is naive at best.
  • CSP Issues: If your app is blocking CSS from the csswizardry.com origin, either self-host the ct.css file, or paste its contents into <style class="ct">…</style> tags anywhere in your page.

ct's People

Contributors

csswizardry avatar

Stargazers

 avatar

Watchers

 avatar

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.