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
Fix wildcard syntax in @forward
(#11482)
#11487
Conversation
9aa02da
to
f83ec5c
Compare
src/language-css/printer-postcss.js
Outdated
insideAtRuleNode(path, "forward") && | ||
iNode.type === "value-word" && | ||
iNode.value && | ||
iNode.value.endsWith("-") && | ||
iPrevNode.type === "value-word" && | ||
iPrevNode.value && | ||
iPrevNode.value === "as" && | ||
iNextNode.type === "value-operator" && | ||
iNextNode.value && | ||
iNextNode.value === "*" |
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.
@alexander-akait Could you check if this condition works file? Sorry I'm not familiar with SCSS...
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 think fine
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.
Ideally we need special logic for @use
/@forward
, but it will require parser for this, postcss-values-parser violate spec in many places, to solve it in right way we need another parser, so I think we can safely merge it
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.
@sosukesuzuki @alexander-akait check is based on official documentation on prefixes. @forward
is available only for Sass files.
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.
Thanks for your quick PR!
@fisker Can you review this? If you approve this, I'll release new patch version. |
Are these valid? Prettier pr-11487 --parser scss Input: @forward "library" as btn*;
@forward "library" as btn-*-x;
@forward "library" as btn*-*; Output: @forward "library" as btn *;
@forward "library" as btn-* -x;
@forward "library" as btn * - *;
|
This should not related to this PR, but somehow cross the printWidth Prettier pr-11487 --parser scss Input: @forward 'library' with (
$black: #222 !default,
$border-radius: 0.1rem !default
); Output: @forward "library" with ($black: #222 !default, $border-radius: 0.1rem !default);
|
Only the first is valid, and I’ve made changes to reflect that. Other two are invalid Sass syntax for |
You’re right, this is not related to this PR. I will create new one with adjustments. EDIT: Done! |
9b5f307
to
4e226bb
Compare
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
I'll release new patch version includes this. |
done |
Description
Fixes #11482.
Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨