Reputation: 7601
I am trying to achieve the following behaviour in WebStorm: https://github.com/bashmish/es6-string-css
I believe I can do this using language injection. I have a TypeScript file with embedded css
const styles = */css*/`
.style {
color: red;
}
`
Upvotes: 1
Views: 376
Reputation: 93728
*/css*/
is not a valid Typescript syntax... For tagged templates like:
const styles = css`
.style {
color: red;
}
`
you can easily create language injections in Settings | Editor | Language Injections.
In 2019.2, it should be an injection of JS Tagged Literal Injection type, like:
for previous versions, see https://youtrack.jetbrains.com/issue/WEB-22106#focus=streamItem-27-2451611.0-0
Upvotes: 1