schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs and SSR.
https://jasprpad.schultek.de
MIT License
1k stars 59 forks source link

Fix: Media Queries add !important? #154

Closed cybertheory closed 5 months ago

cybertheory commented 6 months ago

Description

Since Jaspr relies mainly on inline styles, should we add !important by default? or add a parameter?

Steps To Reproduce

  1. Create a Jaspr app
  2. Use a MediaStyleRule for a class or tag
  3. Style same component
  4. Component wont resize
schultek commented 5 months ago

Adding important by default is not a good idea as it will break lots of layouts. As a parameter also currently won't work because of how the Styles class works. So the only option is to use Styles.raw and add it manually. But I think thats ok because !important generally is not a good practice.