-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Potentially misleading documented behaviour of define:vars #3165
Copy link
Copy link
Closed
Labels
improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)Enhance / update existing documentation (e.g. add example, improve description, update for changes)
Description
Hi there,
The following section of the doc seems rather misleading:
(1) above describes define:vars with respect to both <style> and <script>
(2) describes only the behaviour with <script>
The problem here is with (1)
Correct me if I'm wrong but using define:vars in a <style> within a component markup still bundles the component styles i.e., contrary to what's documented here.
Consider an example with a single component rendered three times and define:vars used on both <style> and <script> elements.
- 1, 2,3 in the screenshot above: the script is inlined as expected. Everything else holds true for the script.
However, this isn't the case for the styles.
- the variable is locally declared on the parent element in the markup
- the style isn't added multiple times with multiple component use (as with a script inline directive)
- the component style is still bundled and locally scoped (not global)
Does the doc here need to be adjusted to exclude styles? i.e., (1)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)Enhance / update existing documentation (e.g. add example, improve description, update for changes)

