SassNinja / postcss-extract-media-query

PostCSS plugin to extract all media query from CSS and emit as separate files.
MIT License
130 stars 20 forks source link

Possibility to leave original file intact? #22

Closed adamrobinson closed 4 years ago

adamrobinson commented 4 years ago

Hi. Firstly thank you for making this plugin.

Is it possible when extracting media queries to leave the original file in tact with all the media queries in it? Im trying to extract all the media queries for mobile into their own file (to help serve to an amp page) but i want to still have the original file (with all media queries) available to serve to the desktop as normal.

At the minute the original file gets transformed to a file missing all the mobile media queries.

SassNinja commented 4 years ago

Hi @adamrobinson

right the plugin extracts the matched media rules and removes them from the original CSS so can better control when to load/apply it.

but i want to still have the original file (with all media queries) available to serve to the desktop as normal.

is there a particular reason why you aren't simply loading all files on desktop? (with http/2 there shouldn't be any performance concern)

SassNinja commented 4 years ago

I'm closing this due to inactivity

as I said there's probably no reasonable use case for such an option