Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>CSS2InlineStyleNew to Visual Studio Code? Get it now.
CSS2InlineStyle

CSS2InlineStyle

Guillaume PANNETIER

|
2,010 installs
| (2) | Free
A simple extension to convert CSS to inline style (and the inverse) that you can use on your React application.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

css2inlinestyle README

css2inlinestyle is a simple extension to convert CSS code to React inline style.

Features

  • Convert css to inline style.
  • Remove prefixes
  • If find duplicate rules, check their values. If the values are similar, just keep one of them. If their values are differents, keep the duplicate values and display a warning message.

Convert CSS to inline style

  1. Select your CSS code
  2. Execute the command "Convert CSS to inline style"
  3. Enjoy !

Convert inline style to CSS

  1. Select your inline style code
  2. Execute the command "Convert inline style to CSS"
  3. Enjoy !

Tip: To bind a keyboard shortcut to the command, open the keybinding preferences and look for "css2inlinestyle" and "inlinestyle2css"

Example

Select the code you want to convert

Select the code you want to convert

Execute the command "Convert CSS to inline style"

Execute the command "Convert CSS to inline style"

Enjoy

Enjoy

Source code

You will find the code on my github repository. Do not hesitate to contribute !

Release Notes

1.2.1

Add gif in readme to be more explicit.

1.2.0

Can now convert inline style to CSS code.

1.1.5

Fix a bug: prefixes were not removed if the rule was not on the first line of the selection

1.1.1 --> 1.1.4

Enhance README.md

1.0.0

Initial release of css2inlinestyle

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft