1
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?

More than 1 year has passed since last update.

nvimでTailwindCSSの色コードを高速にプレビュー

Last updated at Posted at 2023-02-06

nvimでCSSなどの色コードを高速にプレビュー可能なpluginとしてnorcalli/nvim-colorizer.luaがあり、利用しているnvimユーザーも多いかと思います。

しかし、メンテナンスが3年前で止まっていて、その後流行したTailwindCSSの色表示がサポートされないなどの課題があります。

そこで登場したのが上記pluginをforkしたbrenoprata10/nvim-highlight-colorsです。

セットアップ

Plugでの導入例です。この順序で書かないと動作しません。

call plug#begin()
Plug 'brenoprata10/nvim-highlight-colors'
call plug#end()
::
set termguicolors
lua require('nvim-highlight-colors').setup {
    \ 	enable_tailwind = true
    \ }

TailwindCSS用の設定

enable_tailwind = false

redの部分だけ赤になっていて変です。

false.png

enable_tailwind = true

redの部分も正しく表示されています。

true.png

注意

TailwindCSSベースのUIコンポーネントライブラリdaisyUIのbase関連の色などはこのpluginでも表示されません。

1
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
1
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?