-
Notifications
You must be signed in to change notification settings - Fork 392
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: import inline styles #843
Conversation
buffer += ` };\n`; | ||
buffer += `}`; | ||
buffer += 'if (_implicitStylesheets) {\n'; | ||
buffer += ` tmpl.stylesheets ? tmpl.stylesheets.push(_implicitStylesheets) : tmpl.stylesheets = [_implicitStylesheets]\n`; |
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.
Instead of adding that here, what about always adding the stylesheet property in the produced template to avoid the branching here?
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.
good idea
buffer += ` tmpl.stylesheets ? tmpl.stylesheets.push(_implicitStylesheets) : tmpl.stylesheets = [_implicitStylesheets]\n`; | ||
buffer += `}\n`; | ||
|
||
buffer += `tmpl.stylesheetTokens = {\n`; |
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.
Why isn't the template compiler in charge of attaching those properties? Why should it be the compiler?
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 haven't change the attaching on the properties...
A it can' because the implicit css we already had.
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.
Ok no problem.
@@ -101,28 +82,24 @@ export function resetStyleAttributes(vm: VM): void { | |||
/** | |||
* Apply/Update the styling token applied to the host element. | |||
*/ | |||
export function applyStyleAttributes(vm: VM, stylesheet: Stylesheet): void { | |||
export function applyStyleAttributes(vm: VM, hostAttribute, shadowAttribute): void { |
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.
Missing types
8f2511b
to
506bc50
Compare
before the output didnt include: tmpl.stylesheets = []; tmpl.stylesheetTokens = { hostAttribute: "x-foo_foo-host", shadowAttribute: "x-foo_foo" };
@diervo fixed the sourcemap test, was failing cause of a shift (5 lines). |
Benchmark resultsBase commit: lwc-engine-benchmark
|
Benchmark resultsBase commit: lwc-engine-benchmark
|
Benchmark resultsBase commit: lwc-engine-benchmark
|
Merging since all compat failures are flappers... |
Details
Allow import for inline styles.