Visual studio 2017 disable css formatting unnecessary spaces

I have a problem when I try to format css code. Visual studio gives me extra spaces in css

Before formatting css code in visual studio:

.test-parent {
}

.test-parent .test-child {
}

.test-parent .test-child .test-child-child {
}

After formatting the css code in visual studio:

.test-parent {
}

    .test-parent .test-child {
    }

        .test-parent .test-child .test-child-child {
        }

Is it possible to disable extra spaces in visual studio 2017?

+3
source share
1 answer

I believe this function is called Hierarchical Indentation.

You can disable it by doing the following.

  • Select the Tools menu
  • Click "Options" ...
  • Scroll down and expand Text Editor
  • Scroll down and expand CSS
  • Choose Advanced
  • Set Hierarchical Indent to "Off."

Visual Studio CSS .

+7

Source: https://habr.com/ru/post/1677230/


All Articles