From 655b55c51dd86e1bd63ab4c71694e6613376839d Mon Sep 17 00:00:00 2001 From: Goodwine <2022649+Goodwine@users.noreply.github.com> Date: Thu, 27 Oct 2022 16:39:21 -0700 Subject: [PATCH] Indent comma-separated multiline selectors inside @media queries (#1814) * Indent comma-separated multiline selectors inside @media queries * update pubspec and changelog --- CHANGELOG.md | 4 ++++ lib/src/visitor/serialize.dart | 5 +++-- pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f70edd917..3a56b2aae 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/lib/src/visitor/serialize.dart b/lib/src/visitor/serialize.dart index c6c348387..7014c7ec1 100644 --- a/lib/src/visitor/serialize.dart +++ b/lib/src/visitor/serialize.dart @@ -1240,6 +1240,7 @@ class _SerializeVisitor _buffer.writeCharCode($comma); if (complex.lineBreak) { _writeLineFeed(); + _writeIndentation(); } else { _writeOptionalSpace(); } @@ -1318,7 +1319,7 @@ class _SerializeVisitor if (_isTrailingComment(child, previous ?? parent)) { _writeOptionalSpace(); - _withoutIndendation(() => child.accept(this)); + _withoutIndentation(() => child.accept(this)); } else { _writeLineFeed(); _indent(() { @@ -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(); diff --git a/pubspec.yaml b/pubspec.yaml index 92542939c..ae39c83fa 100644 --- a/pubspec.yaml +++ b/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