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.

Using the style attribute doesn't apply all styles

See original GitHub issue

I was pretty confused for a while about why variants such as focus: only work in certain places. Specifically, I was trying to use style={tw`focus:some-property`} and it refused to work until I changed my approach and used tw.button`focus:some-property` . I didn’t find this info in the docs, so I was hoping you could add it to the README or something. I only realized after reading Issue #80

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ben-rogersoncommented, Aug 14, 2020

Yeah all good - I totally understand how this could be confusing, especially if only some of the styles are seemingly working with the style tag. I’m considering going heavy-handed on this by popping an error if tw is used directly on the style tag.

0reactions
ben-rogersoncommented, Sep 24, 2020

From v1.10.0, twin will now pop an error when you try to use tw within a style prop 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my CSS style not being applied? - Stack Overflow
I had custom styling applied only on some elements (rows of table). I use Bootstrap. This was caused ...
Read more >
Dynamic style - manipulating CSS with JavaScript - W3C Wiki
The style object has attributes that correspond to the different CSS properties we set. For example, style.color returns the colour that element has...
Read more >
Specificity - CSS: Cascading Style Sheets - MDN Web Docs
Specificity is the algorithm used by browsers to determine the CSS declaration that is the most relevant to an element, which in turn, ......
Read more >
CSS Class Selectors: How to Use to Style an HTML Element
Moreover, you can avoid repeating the same code for each HTML element that uses the same styling. Hence, the amount of CSS code...
Read more >
How to Troubleshoot CSS Not Working - WPForms
Here's a tutorial that'll walk you through all of the main steps to ... If clearing your browser cache doesn't seem to work,...
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