8000 Deprecate plain-CSS `@import` handling · Issue #4008 · sass/sass · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Deprecate plain-CSS @import handling #4008

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

Open
nex3 opened this issue Dec 27, 2024 · 2 comments
Open

Deprecate plain-CSS @import handling #4008

nex3 opened this issue Dec 27, 2024 · 2 comments
Labels
enhancement New feature or request requires deprecation Blocked on a deprecation cycle

Comments

@nex3
Copy link
Contributor
nex3 commented Dec 27, 2024

The way Sass currently handles plain-CSS @imports is different than the way it handles other plain-CSS at-rules, in a few ways. Once we get rid of dynamic Sass @imports (#3513), we'll want to start treating plain-CSS @imports the same as any at-rule, which means removing these custom behaviors.

The specific behaviors at issue are:

  1. Sass allows multiple comma-separated URLs associated with a single @import, as in @import "foo.css", "bar.css".
  2. Sass handles interpolation in the imported URLs as though they were strings, which is different than how it handles interpolation for all other at-rules. For example, @import url("#{'"'}") currently produces @import url('"') and @import url("#{'\a'}") currently produces @import url("\a"). For other at-rules these produce @foo url(""") and @foo url(" "), respectively. Note that this specifically only occurs for a url() (the only context in which interpolation is allowed in a static import) that contains a quoted string.

The first difference can be detected at parse-time. We don't want to emit deprecations for every interpolation in a static import, so for the second we'll have to detect interpolations that specifically contain characters that have semantically different handling for string-style interpolation, which are quotes, backslashes, carriage returns, line feeds, and null characters. Fortunately, these are generally unlikely to be present in actually-imported URLs, so this shouldn't cause too much user pain.

@nex3 nex3 added enhancement New feature or request requires deprecation Blocked on a deprecation cycle labels Dec 27, 2024
@wellwelwel

This comment has been minimized.

@nex3
Copy link
Contributor Author
nex3 commented Jan 22, 2025

@wellwelwel That has nothing to do with this issue. Please file a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request requires deprecation Blocked on a deprecation cycle
Projects
None yet
Development

No branches or pull requests

2 participants
0