Media queries via (s)CSS
See original GitHub issueFeature Request
What is the desired behavior?
Use media query via mixin in CSS
What is the use-case or motivation for the desired behavior?
From what i’ve read in the DOC if i want a style eg a button with different background color based on breakpoints i can only do something like
<button [ngClass.xs]="xs-button" [ngClass.xs]="md-button">HI!</button>
and in CSS
.xs-button {
background-color: red;
}
.md-button {
background-color: red;
}
This surely works but leads a lot of pollution in the markup, could you also export a mixins to do the below?
With CSS media query:
<button>HI!</button>
button {
background-color: yellow;
@include media-breakpoint(xs) {
background-color: red;
}
@include media-breakpoint(md) {
background-color: blue;
}
}
I can of course crate a set of mixins to do the above but would be great if this would exposed by flex-layout matching configured breakpoints…
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Beginner's guide to media queries - Learn web development
The CSS Media Query gives you a way to apply CSS only when the browser and device environment matches a rule that you...
Read more >Responsive Web Design Media Queries - W3Schools
Media query is a CSS technique introduced in CSS3. It uses the @media rule to include a block of CSS properties only if...
Read more >A Complete Guide to CSS Media Queries
CSS Media queries are a way to target browser by certain characteristics, features, and user preferences, then apply styles based on those ...
Read more >Media queries - web.dev
Adapt your designs to different screen sizes using CSS media queries. ... Designers can adjust their designs to accommodate users. The clearest example...
Read more >The Best Way to Facilitate CSS Media Queries using SCSS ...
This article will explain how to create media queries using SCSS mixins. It will also show how to use the @include function to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This feature will be included in today’s beta 22 release. To use, simply do the following in your SASS files:
@fabiocarneiro see https://github.com/angular/flex-layout/pull/987