webstorm-styled-components icon indicating copy to clipboard operation
webstorm-styled-components copied to clipboard

[Feature Request] Refactor to styled component

Open RuudBurger opened this issue 4 years ago • 2 comments

When developing new components I usually start of writing css inline using the normal style object, like so: <div style={{backgroundColor: 'red', border: '1px solid blue' }} />

It would be nice if this plugin could hook into the refactor context menu and add an "extract Styled Component" option. Just like we already have a "Extract Component..." option: Screen Shot 2021-01-21 at 14 42 56

Then from the aboven example create something like:

const MyComponent = styled.div`
   background-color: red;
   border: 1px solid blue;
`

RuudBurger avatar Jan 21 '21 13:01 RuudBurger

👍 This is one thing I miss a lot from a similar VS Code extension.

patrickmccallum avatar Mar 16 '21 12:03 patrickmccallum

👍 as well. Would love to see this enter the Webstorm workflow since I commonly find myself wanting to auto generate a snippet from the development. Anyone able to tackle this?

danaimone avatar Oct 09 '21 01:10 danaimone