Skip to content

Issues/2380 less each indentation#2455

Open
SarthakDudhe wants to merge 14 commits into
beautifier:mainfrom
SarthakDudhe:issues/2380-less-each-indentation
Open

Issues/2380 less each indentation#2455
SarthakDudhe wants to merge 14 commits into
beautifier:mainfrom
SarthakDudhe:issues/2380-less-each-indentation

Conversation

@SarthakDudhe
Copy link
Copy Markdown

Fixed #2380 in the web/CSS formatter: LESS each(...) callback blocks were causing the surrounding rule to lose its indentation after the callback closed, so sibling selectors like .after { ... } were being pushed back to the root level. I added a small bit of state in
js/src/css/beautifier.js
and mirrored it in
python/cssbeautifier/css/beautifier.py
so the formatter can tell the difference between a real CSS block and a brace that belongs to a parenthesized LESS mixin callback. That lets each(@set, { ... }); close cleanly without stealing the outer rule’s indentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LESS "each" function breaks indentation

1 participant