Last active
April 12, 2020 11:12
-
-
Save willwillems/96c56ba3d36e35bcfecc1a0dbc9bdf2d to your computer and use it in GitHub Desktop.
Indent browser CSS with a simple JS function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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