TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show and Ask HN: Declarative Responsive API on Angular

1 pointsby nilsandreyalmost 5 years ago
In #angular you have a declarative responsive API[1] for short access to responsive. It&#x27;s included on the `FlexLayoutModule` but you can use it without flex or grid elements like tables.<p>The aliases for media queries are very useful for common scenarios. Just feel the words behind the letters:<p>- xs: eXtra Small<p>- sm: SMall<p>- md: MeDium<p>- lg: LarGe<p>- xl: eXtra Large<p>- lt-sm: Lower Than SMall<p>- lt-md: Lower Than MeDium<p>- lt-lg: Lower Than LarGe<p>- lt-xl: Lower Than eXtra Large<p>- gt-xs: Greater Than eXtra Small<p>- gt-sm: Greater Than SMall<p>- gt-md: Greater Than MeDium<p>- gt-lg: Greater Than LarGe<p>As you use it for hiding elements, if you prefer to doesn&#x27;t even send it to the client you are not limited to the declarative API on HTML templates, the script API[2] with MediaObserver lets you be in more control.<p>In general, the so-called module &quot;Angular Layout&quot; provides a sophisticated API using Flexbox, CSS Grid, and mediaQuery. This module provides Angular developers with component layout features using a custom Layout API, media query observables, and injected DOM flexbox-2016 and CSS Grid stylings.<p>There are some advantages[3] including independence of Angular Material and no external CSS requirements among others.<p>The documentation is somewhat limited but I like it a lot but mostly for media queries. It&#x27;s true we can deal with flex and grids directly on CSS but since you were working with Angular this can be useful for that too.<p>Do you have any other recommendations to deal with these 3 aspects (mediaQueries, CssFlex, CssGrid) on Angular?<p>---<p>[1] https:&#x2F;&#x2F;github.com&#x2F;angular&#x2F;flex-layout&#x2F;wiki&#x2F;Responsive-API<p>[2] https:&#x2F;&#x2F;github.com&#x2F;angular&#x2F;flex-layout&#x2F;wiki&#x2F;API-Documentation<p>[3] https:&#x2F;&#x2F;github.com&#x2F;angular&#x2F;flex-layout&#x2F;wiki&#x2F;Why-use-Angular-Layout#advantages

no comments

no comments