-
Notifications
You must be signed in to change notification settings - Fork 134
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
Remove extra newline in css output #144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for proposing this change @ntkme.
LGTM except for one minor nit.
lib/jekyll/converters/scss.rb
Outdated
|
||
if sourcemap_required? | ||
source_map = process_source_map(output.source_map) | ||
generate_source_map_page(source_map) | ||
|
||
if (sm_url = source_mapping_url) | ||
result << "\n/*# sourceMappingURL=#{sm_url} */" | ||
result += "\n/*# sourceMappingURL=#{sm_url} */" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to have blank line before the link to the sourcemap to serve as a visual separation from CSS rules, especially when the rules are compact.
result += "\n/*# sourceMappingURL=#{sm_url} */" | |
result += "\n\n/*# sourceMappingURL=#{sm_url} */" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashmaroli Updated to be consistent with dart-sass: https://github.com/sass/dart-sass/blob/1e211d640a86160910a53de600e3a55f70409470/lib/src/executable/compile_stylesheet.dart#L179-L180
Thanks @ntkme |
This PR removes an extra new line in the css output to make it fully consistent with dart-sass. Previously, a newline is explicitly added to make output compatible with sassc so that the same test case would pass for both implementations. Now the support for sassc is dropped, there is no need to keep that extra newline.
Although this is more of a cosmetic thing, it also has a small performance benefit of avoid copying the frozen string returned from protobuf when source map is disabled.