Skip to content

Commit a103f0e

Browse files
committed
refactor: rename sortMediaQueries option to media
1 parent db27ee6 commit a103f0e

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

package-lock.json

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/posthtml/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function process(html = '', config = {}) {
2828
* will apply to all `<style>` tags in the HTML.
2929
*/
3030
const resolveCSSProps = get(config, 'css.resolveProps', true)
31-
const sortMediaQueries = get(config, 'css.sortMediaQueries')
31+
const mediaConfig = get(config, 'css.media')
3232
const resolveCalc = get(config, 'css.resolveCalc') !== false
3333
? get(config, 'css.resolveCalc', { precision: 2 }) // enabled by default, use default precision 2
3434
: false
@@ -40,7 +40,7 @@ export async function process(html = '', config = {}) {
4040
resolveCSSProps && cssVariables(resolveCSSProps),
4141
resolveCalc !== false && postcssCalc(resolveCalc),
4242
postcssColorFunctionalNotation(),
43-
sortMediaQueries && postcssSortMediaQueries(sortMediaQueries),
43+
mediaConfig && postcssSortMediaQueries(mediaConfig === true ? {} : mediaConfig),
4444
...get(config, 'postcss.plugins', []),
4545
],
4646
merge(

test/postcss.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe.concurrent('PostCSS', () => {
111111
})
112112
})
113113

114-
test('css.sortMediaQueries', async () => {
114+
test('css.media', async () => {
115115
const html = `
116116
<style>
117117
@tailwind components;
@@ -174,7 +174,7 @@ describe.concurrent('PostCSS', () => {
174174
// plugin enabled
175175
posthtml(html, {
176176
css: {
177-
sortMediaQueries: true,
177+
media: true,
178178
tailwind: {
179179
content: [{ raw: html }],
180180
theme: {

0 commit comments

Comments
 (0)