question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamically change wrapper based on tag used

See original GitHub issue

Raised from https://github.com/styled-components/vscode-styled-components/issues/293 Feature in Styled Components: https://styled-components.com/docs/basics#animations

Hey @mjbvz do you know if its possible to dynamically change the root based on the tag used?

In this case we want the keyframes`` tag to use a @keyframes { root instead of the traditional :root { version. Seeing as there’s no way of knowing which tag was used to trigger intellisense the only other option is to heuristically check the contents to know what wrapper to use. If there’s percentage as the first token or from/to switch to @keyframes { wrapper

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
jasonwilliamscommented, May 26, 2021

There’s now a PR for this issue, with support for keyframes

keyframes

0reactions
jasonwilliamscommented, May 26, 2021

Some good news, it seems i can get hold of the tag via context.node.parent.tag.escapedText

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamically changing wrapper tag in React - Stack Overflow
I was wondering if there is a way to dynamically change just the wrapper tag in same line without repeating the code for...
Read more >
Dynamic Wrapper Setup - IDX Broker - Support
In the IDX control panel navigate to Design -> Website -> Wrappers. Choose which wrapper you would like to edit (Global, Categories, Pages,...
Read more >
How to adding dynamic rows/fields to wrapper class?
How can I dynamically update this wrapper class object. In below code i have used only two fields (id, name), but in future...
Read more >
How to conditionally wrap an element in React - Hackages Blog
To render a different wrapping element based on a condition, we can use this one line functional component and determine in our component...
Read more >
Dynamic Tag Name Props in React (with TypeScript)
@equinusocio Yeah, unfortunately, that won't work as far as I can tell. You'll need to use a slot or render prop if the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found