Git Product home page Git Product logo

jekyll-uncss's Introduction

jekyll-uncss

A Jekyll plugin that uses uncss to remove unused css rules in selected stylesheets.

Setup

cd YOUR_JEKYLL_DIR/_plugins && git submodule add https://github.com/episource/jekyll-uncss.git

This plugin depends on uncss. See uncss for installation instructions.

Configure

Configure uncss by adding a uncss node to your _config.yml. The stylesheets option is mandatory, all others are optional. By default all html files (**/*.html) are considered. Use the files option to change this.

For most option there's a corresponding uncss option and the configuration is just passed through (maybe with some path adjustments). A noticable exception is the stylesheets option: Instead of passing all css files to uncss at once (which would result in the stylesheets being merged), the css files are passed one by one. So each file given is processed separately.

uncss:
  stylesheets:            # a list of stylesheets to be processed; mandatory
    - assets/css/main.css
  files:                  # html files to consider, globs are supported; default: **/*.html
    - "**/*.html"
    - "**/*.htm"
  compress: true          # compress resulting css with sass; default: false
  ignore:                 # always keep rules for these selectors; default: none
    - ".is-loading"
    - "#titleBar"
  media:                  # additional media queries to consider; default: undefined
    - print
  timeout: 30             # how long to wait for the JS to be loaded; default: undefined

Note: The ignore option can also be included as a css comment. See uncss documentation for details.

jekyll-uncss's People

Contributors

episource avatar

Watchers

James Cloos avatar Aliou Diallo 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.