0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

coc-tailwindcss3がtailwindcssv4に対応して最高すぎる

Posted at

愛用しているcoc-tailwindcss3プラグインが、Tailwind CSS v4に対応しました!

tailwindcss v4の主な変更点

まずtailwindcss v4の変更点ですが、設定方法など大きな変更がありました。公式アップグレードガイドによると、主な変更点として下記があります:

  • デフォルトでtailwind.config.jsファイルが不要になった
  • 設定ファイルがJavaScriptからCSSへと移行
  • @tailwindディレクティブから通常の@import文への変更
  • モダンブラウザの機能に依存する新しい実装

coc-tailwindcss3の対応内容

GitHubをみると、@yaegassy さんのcoc-tailwindcss3では以下の修正が行われました:

  • package.jsonactivationEventsを変更:
    -    "workspaceContains:**/?(tailwind|tailwind.config|tailwind.*.config|tailwind.config.*).?(js|cjs|ts|mjs)"
    +    "*"
    

以前はtailwind設定ファイルが存在する場合のみプラグインが有効化されていましたが、v4での仕様変更に対応するため、常に有効化されるようになりました。

使い方

coc-tailwindcss3のインストールは以下のコマンドで行えます:

:CocInstall @yaegassy/coc-tailwindcss3

Screenshot 2025-04-09 at 9.58.05.png

クラス名に対応するCSSを表示してくれるのが最高すぎます!

詳細については、GitHubリポジトリを参照してください。

おわりに

tailwindcssで開発していると「クラス名が合っているか」「どのような挙動をするかCSSで知りたい」ということに悩まされがちですが、coc-tailwindcss3を使うことでtailwindcssの開発体験は大きく改善します。Vim + tailwindcss を使っている方には激おすすめのプラグインです!


参考リンク:

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?