blockSelectorLinebreak

Control line break behavior after selector commas.

Possible options:

  • "always": Always insert line break after comma.
  • "consistent": If the whole selector can be put on a single line, there won't be line breaks; otherwise, there will be line breaks after each comma.
  • "wrap": Selector will be put on one line as possible. Once it exceeds printWidth, line break will be inserted where the code exceeds printWidth.

Default option is "consistent".

Example for "always"

Playground

h1,
h2,
h3,
h4,
h5,
h6 {}

Example for "consistent"

Playground

In this example, the first selector can be put on one line, but the second selector can't, so there will be line breaks.

h1, h2, h3, h4, h5, h6 {}
.very-very-very-very-very-very-long-selector,
.very-very-very-very-very-very-very-very-very-long-selector {}

Example for "wrap"

Playground

html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small,
strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label,
legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas,
details, figcaption, figure, footer, header, hgroup, menu, nav, section,
summary, time, mark, audio, video {}

Overriding or ignoring

Selector of specific block can be overridden or ignored by adding a comment directive above the selector.

For example, to ignore it:

/* malva-selector-override ignore */
h1, h2,
h3, h4,
h5, h6 {}

Or, to override with different options:

/* malva-selector-override always */
.container,
.btn {}

This selector will be formatted as "always" disregarding the configuration.

To customize the comment directive text, see the selectorOverrideCommentDirective option.