Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,12 @@ export function format(

if (node.has_prelude && is_selector_list(node.prelude)) {
let list = print_rule_selectors(node.prelude)
// An empty selector list (malformed/unknown block) prints no selector
// lines, so the indentation that print_rule_selectors would normally add
// per-selector has to be added here instead.
if (list === EMPTY_STRING) {
list = indent(depth)
}

let comment = get_comment(node.first_child?.end, node.block?.start)
if (comment) {
Expand Down
2 changes: 1 addition & 1 deletion test/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ test('formats unknown stuff in curly braces', () => {
}
`)
let expected = `selector {
{
{
color: red;
}
}`
Expand Down
Loading