This Visual Studio Code extension provides a convenient tool to convert inline JSX style CSS to standard CSS code. It simplifies the process of extracting and transforming inline styles within JSX components, making your styling workflow more efficient.
Features
Inline Style to CSS Conversion: Quickly convert inline styles within JSX components to standard CSS code.
Special Case Handling: Handle special cases intelligently, providing meaningful and accurate CSS output.
Installation
Open Visual Studio Code.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or use the keyboard shortcut Ctrl+Shift+X.
Search for "jsx-css-converter".
Click the Install button for the extension publisged by yagizcer.
Usage
Open a JSX file containing inline styles.
Select the JSX code with inline styles.
Right-click on the selected code.
Choose the "Convert jsx styles to css" option from the context menu.
The converted CSS code will copied to your clipboard.
Example
// Start highligthing whatever you want (careful to include style data)
const MyComponent = () => (
<div style={{ backgroundColor: "blue", fontSize: "16px" }}>Hello World!</div>
);
/* Copied to Your Clipboard*/
background-color: blue;
font-size: 16px;