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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Flow Charts with CSS Anchor Positioning

163 点作者 roosgit11 个月前

13 条评论

dgb2311 个月前
Neat examples!<p>However I think I would still use SVG for these sorts of things, especially since they can easily be manipulated, animated and are more mathematically declarative than CSS anchor positioning.<p>I think the sweet spot for this CSS feature is not having to do complex workarounds with calc, positioning, transforms or JS in order to have more control over positioning elements relative to others. Container queries have a similar use case.<p>Both of these features (as well as CSS grid) are born out of the same underlying issues:<p>- HTML and CSS are not orthogonal in terms of layout, but very tightly coupled<p>- Trees are a fundamentally crippled data structure to express layouts. Almost every sufficiently complex layout wants to be represented as a graph or a matrix. Trees are fine until they aren&#x27;t.
评论 #40823361 未加载
bugfactory11 个月前
I&#x27;m constantly amazed by how much can be achieved with only CSS nowadays. It seems like it&#x27;s getting more powerful by the month as developers find new and tricky ways to push the boundary ;)
评论 #40811407 未加载
评论 #40808911 未加载
评论 #40809035 未加载
ericyd11 个月前
Friendly warning that anchor positioning is not yet available in any non-Chromium-derived browser.
xnx11 个月前
We might have pushed CSS further than it should go, but using gradient for the connector lines is pretty clever.
评论 #40809502 未加载
评论 #40809050 未加载
评论 #40808673 未加载
评论 #40812541 未加载
评论 #40808680 未加载
lenkite11 个月前
Ideally, browsers should offer an API where a certain rect on screen can be rendered as SVG or PNG. Then such CSS flowcharts can be distributed as independent images instead of being a web-page.
评论 #40809023 未加载
评论 #40812944 未加载
评论 #40809368 未加载
simple1011 个月前
Thanks for sharing. This has a lot of promise once browsers fully support anchor positioning. With the current rate of CSS standards adoption, my guess is Firefox and Safari will add support by end of this year. Pure speculation as they haven&#x27;t announce support plans yet AFAIK.<p>Chrome and Edge currently support anchor positioning: <a href="https:&#x2F;&#x2F;caniuse.com&#x2F;?search=css-anchor-positioning" rel="nofollow">https:&#x2F;&#x2F;caniuse.com&#x2F;?search=css-anchor-positioning</a>
autoexec11 个月前
Considering this is a CSS trick, it&#x27;d be nice if all the demos didn&#x27;t require&#x2F;load a ton of JS. Viewing source on the demos shows them to be like 90% javascript, several tens of thousands of characters, and that doesn&#x27;t even include the five external JS files it also loads.
sollniss11 个月前
Connector lines not showing in Firefox.
评论 #40808893 未加载
评论 #40808883 未加载
AstroJetson11 个月前
I just use Markdeep and create the block diagrams that way<p><a href="https:&#x2F;&#x2F;casual-effects.com&#x2F;markdeep&#x2F;features.md.html#diagramexamples&#x2F;flowchart" rel="nofollow">https:&#x2F;&#x2F;casual-effects.com&#x2F;markdeep&#x2F;features.md.html#diagram...</a>
mediumsmart11 个月前
div popover in css <i>… yay</i>
meindnoch11 个月前
Great. Yet another special case added to CSS.
the_other11 个月前
Flow charts are a terrible use case for CSS (and HTML). The nodes and edges of a flow chart are all meaningful data. When you render the connectors using a mixture of empty divs, pseudo-content and largely arbitrary hacks, all that meaning gets lost from the _content_ (the HTML). Access tooling will largely fail to communicate your intent.<p>Flow charts are much better represented by something like PlantUML or Mermaid, and then rendered direct to SVG or a canvas. The mark-up is much more human-readable and could be used as source to drive an even-more accessible alternative.
评论 #40809187 未加载
评论 #40809080 未加载
评论 #40810964 未加载
评论 #40809588 未加载
评论 #40811234 未加载
gavinbao11 个月前
Is it possible that it can create a flow chart library with pure css? maybe like we make the className like tailwind to let others use to easily ship flow chat with pure css?