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

Parse native CSS nesting in plain CSS #3524

Closed
5 tasks done
nex3 opened this issue Mar 29, 2023 · 6 comments · Fixed by #3841
Closed
5 tasks done

Parse native CSS nesting in plain CSS #3524

nex3 opened this issue Mar 29, 2023 · 6 comments · Fixed by #3841
Labels
CSS compatibility Support the CSS spec enhancement New feature or request planned We would like to add this feature at some point

Comments

@nex3
Copy link
Contributor

nex3 commented Mar 29, 2023


Although we're preserving Sass's current nesting behavior for now (per #3030), we can support native CSS nesting when parsing plain CSS. We shouldn't do any resolution here, just pass it through as-is.

@nex3 nex3 added enhancement New feature or request CSS compatibility Support the CSS spec planned We would like to add this feature at some point labels Mar 29, 2023
nex3 added a commit that referenced this issue Mar 31, 2023
nex3 added a commit that referenced this issue Apr 6, 2023
See #3524

Co-authored-by: Jennifer Thakar <jathak@google.com>
@nex3
Copy link
Contributor Author

nex3 commented Apr 6, 2023

Proposal is out, since this is a low-risk subset of plain CSS nesting support I'll give this two weeks for public comment.

@flachware
Copy link

I appreciate the efforts to bring native nesting to Sass. Please clarify, do I understand correctly that this means that all features of Sass are available in .css files, except for Sass’ nesting?

@nex3
Copy link
Contributor Author

nex3 commented Apr 7, 2023

No, no Sass features are available in .css files. They are parsed strictly as plain CSS. See https://sass-lang.com/documentation/at-rules/use#loading-css for details.

@flachware
Copy link

Pity, so it’s either Sass or native nesting. But thanks for clarifying.

@ggedde
Copy link

ggedde commented Sep 5, 2023

@nex3 I am a little confused as to how this will work. Sorry the documentation is a bit hard to understand. I just tested using @use with a plain .css file, but nesting does not work as it gives an error. Is there no way to currently import an plain .css file and leave it exactly as the way it is and ignore all errors? Is there any error suppression setting, etc? Or are you saying that we will have to wait for that?

I guess I can just run some sort of npm package/command after sass parse to add my plain css to the final bundle, etc.

@nex3
Copy link
Contributor Author

nex3 commented Sep 6, 2023

This issue is still open and the checkbox for "Dart Sass" isn't checked, which indicates that this has not yet been implemented.

nex3 added a commit to sass/sass-spec that referenced this issue Mar 16, 2024
nex3 added a commit to sass/dart-sass that referenced this issue Mar 16, 2024
nex3 added a commit to sass/sass-spec that referenced this issue Mar 20, 2024
nex3 added a commit to sass/sass-spec that referenced this issue Mar 20, 2024
nex3 added a commit to sass/dart-sass that referenced this issue Mar 22, 2024
nex3 added a commit that referenced this issue Apr 19, 2024
nex3 added a commit that referenced this issue Apr 19, 2024
Closes #3524

Co-authored-by: Carlos (Goodwine) <2022649+Goodwine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS compatibility Support the CSS spec enhancement New feature or request planned We would like to add this feature at some point
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants