Skip to content

Instantly share code, notes, and snippets.

@willwillems
Last active April 12, 2020 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willwillems/96c56ba3d36e35bcfecc1a0dbc9bdf2d to your computer and use it in GitHub Desktop.
Save willwillems/96c56ba3d36e35bcfecc1a0dbc9bdf2d to your computer and use it in GitHub Desktop.
Indent browser CSS with a simple JS function
const indent = code => code
.replace(/{\s+/, '{\n ')
.replace(/(?<=;)\s+/gm, '\n ')
.replace(/(?<=;)\s+}/, '\n} ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment