TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show and Ask HN: Declarative Responsive API on Angular

1 点作者 nilsandrey大约 5 年前
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

暂无评论

暂无评论