Suggestion: add classes at breakpoints
See original GitHub issueIn many cases I don’t want to create multiple elements for large/small layouts, I simply need a different css class applied. It would be nice to have a directive that would apply a css class based on the screen size (versus show/hiding the element). For example:
<p *sm-class="my-small-class" *lg-class="my-big-class">example</p>
When the window is small, .my-small-class
is applied to the element, and when the screen is large, .my-big-class
would be applied to the element.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Is there any way to set breakpoints on all methods of a class?
You can follow the steps below: Run -> View breakpoints -> Add -> Java Method Breakpoints. Class pattern -> full reference of your...
Read more >The 100% correct way to do CSS breakpoints - freeCodeCamp
So I have three suggestions: Get your breakpoints right; Name your ranges sensibly; Be declarative. Tip #1: Get your breakpoints right. So what ......
Read more >Style across breakpoints | Webflow University
Add and change styles, determine style inheritance, and clear styles using breakpoints in the Designer.
Read more >CSS · Bootstrap
Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller...
Read more >Breakpoints for Responsive Web Design - BrowserStack
What is a Breakpoint in Responsive Design? · When Should a Standard Responsive Breakpoint be Added? · Best Practices for Adding Standard ...
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 Free
Top 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
I’ve just come across this repository so forgive me if this is already a feature, but what about injecting a service into components, that way we can use the ngClass directive, and even trigger functions on changes to orientation etc.
Hi,
That’s sound a good idea, but maybe instead of changing the class on the element, wouldn’t it be easier if there was a specific class on the body like “responsive-breakpoint-lg”. We could also add other devices information. In the application you could then use the class as a media query to handle different layout according to the screen size:
The main advantages of this :
Would this meet your requirements ?