我正在使用带有ReactJs(jsx)的CSS模块。有没有办法在Emmet或Atom中创建自定义代码段以使用CSS模块而不是常规类?
示例,目前Emmet的工作原理如下:
.title
扩展为<div className="title"></div>
我希望能够创建类似于以下内容的代码段:
.styles-title
扩展为<div className={styles.title}></div>
答案 0 :(得分:2)
This actually turned out to be rather tricky. Emmet and the Atom extension both allow for customization, but a security policy in Atom does not allow loading custom filters from outside the extension.
With some nudging in the right direction (see the GitHub issue linked above) I was able to write my own Atom extension that does this.