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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Modern CSS for Dynamic Component-Based Architecture

179 点作者 Twixes将近 2 年前

5 条评论

Guest71022将近 2 年前
Comprehensive article.<p>I’ve long given up trying to keep up with everything added to the spec since about `display: flex`. There’s just too much stuff, and the shoehorning of features into a syntax&#x2F;spec from 1996 doesn’t appear to me to be a sustainable long term strategy to facilitate increasingly complex web applications.<p>Maybe it’s been considered, but some use of namespaces and modules in the syntax could at least help developers opt into specific CSS modules and let other developers know what magic they can expect to find in the stylesheet.<p>``` @use grid @use container @use layer<p>@layer layout { .layout-grid { --layout-grid-min: 30ch; --layout-grid-gap: 3vw;<p><pre><code> display: grid; grid-template-columns: repeat( auto-fit, minmax(min(100%, var(--layout-grid-min)), 1fr) ); gap: var(--layout-grid-gap); }</code></pre> }<p>@layer layout { :is(.layout-grid, .flex-layout-grid) &gt; * { container: var(--grid-item-container, grid-item) &#x2F; inline-size; } }<p>```
评论 #36377672 未加载
评论 #36377002 未加载
评论 #36376297 未加载
评论 #36376371 未加载
评论 #36382356 未加载
chrisweekly将近 2 年前
Good resource, w&#x2F; useful examples, from a &quot;here&#x27;s how to start incorporating some of the new stuff&quot; angle. For more of a &quot;building things from first principles&quot; foundation, I continue to recommend <a href="https:&#x2F;&#x2F;every-layout.dev" rel="nofollow noreferrer">https:&#x2F;&#x2F;every-layout.dev</a>.
armchairhacker将近 2 年前
2 questions:<p>- Is there a modern version of the CSS Zen Garden? <a href="https:&#x2F;&#x2F;www.csszengarden.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.csszengarden.com&#x2F;</a> is very old<p>- From people who know CSS better than I do, do these features make TailwindCSS less useful &#x2F; necessary? Though I&#x27;m sure much of the answer is &quot;TailwindCSS is a different paradigm&quot; since it&#x27;s basically inline styles, and CSS is basically non-inline styles.
评论 #36378057 未加载
评论 #36376731 未加载
la_fayette将近 2 年前
Oh wow, i wasn&#x27;t aware of nesting support in native css, with variables and nesting, there seems to be no real reason for using sass anymore...
评论 #36377678 未加载
yxre将近 2 年前
Sometimes I think I know everything that I need to know about web dev, but then I read something like this and learn about new features that I didn&#x27;t know of.<p>I hope they think about deprecating some features or slowing down on adding features. Letting developers rely on transpilers is great way to keep the core language simple while letting people do anything they want.
评论 #36377279 未加载