-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
define:vars does not work when using dynamic tags #7534
Copy link
Copy link
Closed as not planned
Labels
- P2: has workaroundAn edge case that only affects very specific usage, but has a trivial workaround (priority)An edge case that only affects very specific usage, but has a trivial workaround (priority)
Description
What version of astro are you using?
2.7.2
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
Setting dynamic tag like: const Element = shouldBeButton ? 'button' : 'div' and than using it on the top level: <Element>Some Text</Element> of the html causes define:vars to not work. There is no style="--myVar: value" inside button or div element.
What's the expected result?
Astro should render chosen element with style="--myVar: value" attribute.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/astro-minimal-example-custom-tags
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
- P2: has workaroundAn edge case that only affects very specific usage, but has a trivial workaround (priority)An edge case that only affects very specific usage, but has a trivial workaround (priority)