4

I have CSS file generated by Sass compiler, but the text inside the CSS file is all on one line.

Is there a way to indent and or format it properly on Notepad++ and VSCode?

enter image description here

I have tried installing the XML Tools plugin, and then pressing the Pretty print, but nothing happens.

3
  • You can use an online tool like this, there's plenty of them out there :) Commented Nov 25, 2022 at 8:14
  • @VilleKoo How does this work? I pasted the code inside, but nothing happens. I downloaded it, but it's just a txt file, and the code inside looks the same. Commented Nov 25, 2022 at 8:27
  • I'm afraid there are no N++ plugins that do such job. You can replace all ;-- with ;\r\n-- Commented Nov 25, 2022 at 10:34

1 Answer 1

1

To format CSS in Notepad++:

  • Go to Plugins > Plugin Manager > Show Plugin Manager.
  • Select the JSTool Plugin and click Install
  • Go to Plugins > JSTool > JSFormat OR use keyboard shortcut Ctrl + Alt + M

enter image description here

is resulting in:

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

Not exactly what we want, needs further replacement ^ ([a-zA-Z]+) - ([a-zA-Z]+)\s*: with ```` \1-\2:````. Maybe not just that.
It messes with classes/ids and properties containing '-'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.