styled-components / webstorm-styled-components

styled-components highlighting support in IntelliJ editors
https://plugins.jetbrains.com/plugin/9997-styled-components
MIT License
375 stars 19 forks source link

Support configuring additional component tags #64

Closed undeadcat closed 5 years ago

undeadcat commented 5 years ago

This adds support for configuring additional tags to be treated as styled-components. image

Example taken from tips-and-tricks:

const Container = styled.div`
  color: #333;
  ${media.desktop`padding: 0 20px;`}
  ${media.tablet`padding: 0 10px;`}
  ${media.phone`padding: 0 5px;`}
`

Adding media to the list of tags allows literals with tags starting with 'media' to have highlighting and completion. image

Multiple issues that requested something similar: #39, #40, #47,#56. The TypeScript plugin, typescript-styled-plugin, supports a similar degree of configuration.

There are some minor housekeeping changes (dependency versions, rename) included with the feature, sorry about that, but they are separated into different commits, didn't seem to make sense to create separate PRs for them. Minimum IDE version is now 2018.1.

Please let me know if I should explain the changes made to the code.

undeadcat commented 5 years ago

@daedlock, Thanks! Published 1.0.7.