You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use <style webc:scoped="hash"> in a component, the class="hash" will only be applied to the root node.
But on a page it will be set to all nodes.
letwebc=newWebC();webc.defineComponents("./my-component.webc");webc.setContent("<my-component></my-component>")let{ html }=awaitwebc.compile();console.log(html.trim());
When I use
<style webc:scoped="hash">
in a component, theclass="hash"
will only be applied to the root node.But on a page it will be set to all nodes.
Example 1:
my-component.webc:
transformed with the following code:
Will produce:
Note that the
p
tag has no class Attribute.Whereas, if I use
webc:scoped
in a page the class attribute will be applied to all nodes.Example 2:
will produce:
I would expect only the top div to have the class Attribute.
It seems to be connected with the following code pointers:
https://github.com/11ty/webc/blob/v0.11.4/src/ast.js#L384
and
https://github.com/11ty/webc/blob/v0.11.4/src/ast.js#L431
which apply the root attributes including the class attribute to all nodes.
The text was updated successfully, but these errors were encountered: