Skip to content

iamdustan/queryless

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Queryless, with Rework

Build Status Code Climate

Queryless is a rework utility to automatically create media-query free stylesheets for archaic browsers such as IE8.

Usage

Simply pass in queryless to your rework pipeline with an array of media queries you would like to extract. The match is based on the media queries you are using in your project. They don't have to be an exact match, but is a subset. Look in test/cases for examples.

// Create a stylesheet with all media queries that match
// larger than 600px wide and the print media block.

var keepmatches = [
  'screen and (min-width: 600px)', // assumes the units entered here are the same used in your CSS.
  'print'
];

var css = rework(input)
  .use(queryless(keepmatches))
  .toString();

Upgrade Note

The 0.0.x branch was much more complex and attempted to dynamically resolve media queries. This was over-complicated waste—you know your media-queries best.

In 0.1.x the match is string based. It should be much quicker and much more dependable in complex situations.

License

MIT.

About

Create a mediaquery free stylesheet for archaic browsers

Resources

License

Stars

Watchers

Forks

Packages

No packages published