Comment Indent

Applies single indentation to containing content of style (block) comments which span multiple lines. This is a style specific formatting rule which will be applied to CSS and SCSS Languages. It will default to using false when no option has been specified and the recommended option to use is true.


👎

false

The commentIndent rule is disabled by default, so style block comments do not apply indentation. Style block comment contents will have indentation removed in the sample when formatting.

.class-0 {
  width: 100%;
  height: 100%;
  /*
  *some comment
  */
  padding: 1em 3.8em;
  overflow: auto;
}
/*
* some comment
*/
.class-1 {
  position: absolute;
  z-index: 100;
  width: 100%;
  height: 100%;
  /*
  *some comment
  */
  margin: 0;
 /*
  *some comment
  */
  padding: 1em 3.8em;
  overflow: auto;
  inset: 0;
}
.class-0 {
  width: 100%;
  height: 100%;


  /*
  *some comment
  */
  padding: 1em 3.8em;
  overflow: auto;
}


/*
* some comment
*/
.class-1 {
  position: absolute;
  z-index: 100;
  width: 100%;
  height: 100%;


  /*
  *some comment
  */
  margin: 0;


  /*
  *some comment
  */
  padding: 1em 3.8em;
  overflow: auto;
  inset: 0;
}

🙌

true

Below is an example of how this rule works if it’s enabled (true). Notice how after formatting when this rule is enabled that the inner contents of the Style block comments are indented.

.class-0 {
  width: 100%;
  height: 100%;
  /*
  *some comment
  */
  padding: 1em 3.8em;
  overflow: auto;
}
/*
*some comment
*/
.class-1 {
  position: absolute;
  z-index: 100;
  width: 100%;
  height: 100%;
  /*
  * some comment
  */
  margin: 0;
 /*
  *some comment
  */
  padding: 1em 3.8em;
  overflow: auto;
  inset: 0;
}
.class-0 {
  width: 100%;
  height: 100%;


  /*
  *some comment
  */
  padding: 1em 3.8em;
  overflow: auto;
}


/*
*some comment
*/
.class-1 {
  position: absolute;
  z-index: 100;
  width: 100%;
  height: 100%;


  /*
  * some comment
  */
  margin: 0;


  /*
  *some comment
  */
  padding: 1em 3.8em;
  overflow: auto;
  inset: 0;
}