feat(language/css): switch to css-ts-mode

This commit is contained in:
2024-10-24 02:04:27 +01:00
parent 074ac916ab
commit 18db9153dd
2 changed files with 40 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
:defer t
:hook
((css-mode
css-ts-mode
markdown-mode
php-mode
typescript-mode

View File

@@ -17,10 +17,48 @@
:custom
(css-indent-offset 2)
:custom-face
(css-selector ((t (:inherit font-lock-keyword-face :foreground nil))))
(css-property ((t (:inherit font-lock-constant-face :foreground nil))))
:preface
(defun siren-css-mode-setup ()
(setq-local tab-width 2)
(setq-local tab-width css-indent-offset)))
(when (fboundp 'css-ts-mode)
(use-package css-ts-mode
:straight (:type built-in)
:mode "\\.css\\'"
:hook
(css-ts-mode . siren-css-ts-mode-setup)
:general
(:keymaps 'css-ts-mode-map
"C-j" 'newline-and-indent)
:custom
(css-indent-offset 2)
:custom-face
(css-selector ((t (:inherit font-lock-keyword-face :foreground nil))))
(css-property ((t (:inherit font-lock-constant-face :foreground nil))))
:preface
(defun siren-css-ts-mode-setup ()
(setq-local tab-width css-indent-offset))
:config
(siren-treesit-auto-ensure-grammar 'css)))
(use-package lsp-css
:straight lsp-mode
:hook
(css-mode . siren-lsp-css-mode-setup)
(css-ts-mode . siren-lsp-css-mode-setup)
:preface
(defun siren-lsp-css-mode-setup ()
(lsp-deferred)))
(provide 'siren-css)