mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.41k stars 410 forks source link

Support CSS in JS syntax #501

Closed gitusp closed 3 years ago

gitusp commented 3 years ago

Related issue: https://github.com/mattn/emmet-vim/issues/427

It adds styledEmmetAbbreviation syntax to styledDefinition region which is defined in this syntax plugin. Then, defines the syntax as styled type which extends css. Since CSS in JS does not require { region } to write properties, it adds type !=# 'styled' condition to emmet#lang#css#parseIntoTree function, as sass type does.

Although it requires https://github.com/styled-components/vim-styled-components to work, it should not harm environments where the plugin is not installed, because syntax match styledEmmetAbbreviation "[a-z0-9#+!%]\+" containedin=styledDefinition contained does nothing if styledDefinition is not defined.

Thank you!

mattn commented 3 years ago

This PR does not break anything for current behavior. So merging. Thank you.