Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indent comma-separated multiline selectors inside @media queries #1814

Merged
merged 2 commits into from Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.55.1

* Fix indentation for selectors that span multiple lines in a `@media` query.

## 1.55.0

* **Potentially breaking bug fix:** Sass numbers are now universally stored as
Expand Down
5 changes: 3 additions & 2 deletions lib/src/visitor/serialize.dart
Expand Up @@ -1240,6 +1240,7 @@ class _SerializeVisitor
_buffer.writeCharCode($comma);
if (complex.lineBreak) {
_writeLineFeed();
_writeIndentation();
} else {
_writeOptionalSpace();
}
Expand Down Expand Up @@ -1318,7 +1319,7 @@ class _SerializeVisitor

if (_isTrailingComment(child, previous ?? parent)) {
_writeOptionalSpace();
_withoutIndendation(() => child.accept(this));
_withoutIndentation(() => child.accept(this));
} else {
_writeLineFeed();
_indent(() {
Expand Down Expand Up @@ -1431,7 +1432,7 @@ class _SerializeVisitor
}

/// Runs [callback] without any indentation.
void _withoutIndendation(void callback()) {
void _withoutIndentation(void callback()) {
var savedIndentation = _indentation;
_indentation = 0;
callback();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,5 +1,5 @@
name: sass
version: 1.55.0
version: 1.55.1-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down