cssmergemedia

Software Screenshot:
cssmergemedia
Software Details:
Version: 0.1.1
Upload Date: 14 Apr 15
Developer: Adrien Kohlbecker
Distribution Type: Freeware
Downloads: 8

Rating: 4.0/5 (Total Votes: 1)

cssmergemedia is a Python tool that merges identical media queries in your CSS.

For example, the following CSS:

    @media screen and (min-width: 480px) and (max-width:899px) {
     .foo {
       color:black;
     }
    }

    @media screen and (min-width: 480px) and (max-width:899px) {
     .bar {
       background:red;
     }
    }


Is compiled to:

    @media screen and (min-width: 480px) and (max-width:899px) {
     .foo {
       color:black;
     }
     .bar {
       background:red;
     }
    }


This allows you to keep your media queries along with the base style for each element, instead of grouping them together at the end of the file or in a separate file (and thus turning maintenance into a nightmare)

CSS Merge Media is based on cssutils: what can be parsed with cssutils can be used in the script.

Installation

Unpack the tarball and run::

  python setup.py install

Invocation

Invoke the script like so::

  cssmergemedia --input style.css --output style-merged.css

What is new in this release:

  • Fixed dependecy check on install

Requirements:

  • Python

Similar Software

Comments to cssmergemedia

Comments not found
Add Comment
Turn on images!