https://github.com/songsterr/postcss-unwrap-mq
PostCSS plugin to extract matched media queries to their parents
https://github.com/songsterr/postcss-unwrap-mq
css media-query postcss postcss-plugin unwrap
Last synced: 6 months ago
JSON representation
PostCSS plugin to extract matched media queries to their parents
- Host: GitHub
- URL: https://github.com/songsterr/postcss-unwrap-mq
- Owner: songsterr
- License: mit
- Created: 2019-12-03T09:40:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-07T10:55:58.000Z (over 2 years ago)
- Last Synced: 2025-11-03T14:33:25.949Z (8 months ago)
- Topics: css, media-query, postcss, postcss-plugin, unwrap
- Language: JavaScript
- Size: 1.09 MB
- Stars: 2
- Watchers: 10
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PostCSS Unwrap Mq
[PostCSS] plugin to extract matched media queries to their parents.





[PostCSS]: https://github.com/postcss/postcss
```css
.foo {
/* Input example */
}
@media print {
.bar {
}
}
```
```css
.foo {
/* Output example */
}
.bar {
}
```
## Usage
Check you project for existed PostCSS config: `postcss.config.js`
in the project root, `"postcss"` section in `package.json`
or `postcss` in bundle config.
If you already use PostCSS, add the plugin to plugins list:
```diff
module.exports = {
plugins: [
+ require('postcss-unwrap-mq')({
+ regex: /print/,
+ }),
require('autoprefixer'),
],
}
```
If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.
[official docs]: https://github.com/postcss/postcss#usage