Emmet: How to change jsx className behavior for css-modules

Created on 29 Mar 2018  路  8Comments  路  Source: emmetio/emmet

I'm trying to alter the behavior of emmet for classes in jsx to use a css module rather than a string:

| abr | current | desired |
|---|---|---|
| div.a | <div className="a"></div> | <div className={styles.a}></div> |

However, I can't seem to figure out how to achieve this. as for as I understand I need a custom filter to do this. and I'm not even sure if custom filters are possible.

Is somebody able to point me in the right direction?

Most helpful comment

@midgethoen do you fix this in vscode?

All 8 comments

so I overlooked this sentence in the docs:

Each .js file located in extensions folder will be loaded and executed on plugin start-up. Use js files to create your own filters or actions: you can use Emmet modules and bindings to script your editor with JavaScript.

I'm now trying to get this to work

So I'm using emmet as part of vscode. And although it does support configuring an extensionPath.
it only loads snippets.json and syntaxProfiles.json..

Which took me a while to figure out 馃槙

so I guess im moving on to trying to understand how emmet integration works in vscode specifically

Any update for this? I just moved from Atom, and in Atom you have that plugin: https://github.com/ambethia/emmet-jsx-css-modules

@midgethoen do you fix this in vscode?

Any updates?

Will try to add this feature in updated Emmet version

Any updates on this?

Since I鈥檓 finishing Emmet 2 implementation, let鈥檚 continue discussion here: https://github.com/emmetio/emmet/issues/589

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renatorib picture renatorib  路  26Comments

sergeche picture sergeche  路  25Comments

corysimmons picture corysimmons  路  5Comments

DanielRuf picture DanielRuf  路  5Comments

HeikoMamerow picture HeikoMamerow  路  16Comments