0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

tailwindcss を purgecss するときに postcss-sort-media-queries を使ってはダメ

Posted at

tailwindcss を postcss で purgecss しています。

tailwindcss の container をメディアクエリで書いていたのですが、
purgecss 後に挙動がおかしい。

<div class="lg:conteiner">test</div>

とかいた場合、1024px 以上のみ container クラスの指定が作用するのですが、
postcss-sort-media-queries を併用して postcss するとしてと 1024px 未満でも container の指定が作用しています。

これは、 tailwindcss が @media の順番で contianer の振る舞いを操作していたのに、
postcss-sort-media-queries で @media の指定順番を崩してしまったせいです。

ですので、tailwindcss を purgecss するときは postcss-sort-media-queries を使ってはダメなのです。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?