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

Remove extra newline in css output #144

Merged
merged 2 commits into from Dec 8, 2022
Merged

Remove extra newline in css output #144

merged 2 commits into from Dec 8, 2022

Conversation

ntkme
Copy link
Contributor

@ntkme ntkme commented Dec 8, 2022

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.

Copy link
Member

@ashmaroli ashmaroli left a 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.


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} */"
Copy link
Member

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.

Suggested change
result += "\n/*# sourceMappingURL=#{sm_url} */"
result += "\n\n/*# sourceMappingURL=#{sm_url} */"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntkme ntkme requested a review from ashmaroli December 8, 2022 06:04
@ashmaroli
Copy link
Member

Thanks @ntkme
@jekyllbot: merge +major

@jekyllbot jekyllbot merged commit d0e46da into jekyll:master Dec 8, 2022
jekyllbot added a commit that referenced this pull request Dec 8, 2022
@jekyll jekyll locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants