-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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(css): no emit assets in html style tag (use class) (fix #5968) #6048
Conversation
oh, how to fix the test error |
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 the code could use some comments to describe each part's goal, it took me a while to understand the flow. I have one concern below, but otherwise this looks good to me. Pretty neat implementation too! I thought it would be longer.
I'd also prefer if another maintainer more experienced with this could take a look, this is my first time understanding this file 😅
PS: Feel free to add more comments where you see fit.
js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.css"` | ||
if (classPropsNode) { | ||
const classPropValue = classPropsNode.value! | ||
s.remove(inlineStyle.loc.start.offset, inlineStyle.loc.end.offset) |
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.
Do we need to remove the inline style if classPropsNode
is false too?
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.
false will overwrite the style prop to the class.
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.
Ah yes. Thanks for the explanation
I'm also checking, LGTM too. We are going to try to discuss it in the next team meeting |
ok, I will comment it |
Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Shinigami <[email protected]>
Co-authored-by: Shinigami <[email protected]>
Co-authored-by: Shinigami <[email protected]>
Co-authored-by: Shinigami <[email protected]>
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.
Looking good!
Does it PR has any difference with #6181? |
yes, but I don't know how to mentioned pull request😅 |
Please review at the mentioned PR @patak-dev @Shinigami92 @bluwy. |
I'm not sure which way to take in the end. I'll change PR name? |
Description
fix: #5968
Additional context
traverseHtml
?createHTMLCSSCompiler
?What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).