Skip to content

day6 #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

day6 #189

wants to merge 5 commits into from

Conversation

sakupi01
Copy link
Owner

@sakupi01 sakupi01 commented Jul 12, 2025

@Jxck
Day6 の記事を執筆しました。お手隙でレビューいただけると幸いです!
(書き方が悪いのか、全然進まなかった・・・;-;)

Copy link

vercel bot commented Jul 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blog.sakupi01.com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 20, 2025 5:54am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
git-kusa ⬜️ Skipped (Inspect) Jul 20, 2025 5:54am

Copy link

@Jxck Jxck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

面白くはなってきているし、書きたいことを書けるフェーズになってきて、筆も乗ってるのかなという気はする。が、書き散らかし感があって「今どこに向かうなんの話がしたいんだっけ?」がよくわからなくなってきてる気もする。(興味があって読んでる人も、離脱するのにちょうどいい感じ)

前回までで、Cascade が「Suggest/Influence」するものであり、`!important` が「create a balance」するものであるという、Cascade の基本思想を解説してきました。
これを踏まえた上で、2025年現在、我々が慣れ親しんでいる CSS の Cascade について、改めて整理したいと思います。

Cascade に関しての詳説は、すでに日本語でも良質なものが多く存在します。よって、本エントリでは、CSS や Cascade の根幹となる思想を基に、Cascade を解説していくものにできればと思います。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「すでに良質のものがある」で前振るなら「だから今回は〜を端折る」とか、そこと差別化がある、みたいに続くとおもいきや、なんか「真っ向から書きます」みたいになってるので、振り方か続け方が違いそう。


同じ「CSS Cascading and Inheritance」というカテゴリではありますが、RT で同一のステータスとして管理されるに相応しくなく、それぞれの実装状況や仕様の安定具合に応じて異なる進捗を持たせるのが妥当であれば、異なる Level に分類されます。

:::
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここまでの二つのノート。書きたかったから書いただけ感が強い。
別にいんだけど、伝えたいこと(読み進める上でここは把握しておいて欲しい)が、あるのかないのかもよくわからん。
無いなら、まるっといらなそう。
有るなら、それを伝える努力を怠りすぎ。


## The Cascade - Cascade Sorting Order

現在、皆さんがみているこのページのスタイルは、完全に CSS ルールの競合が解決され、計算された結果として現れているスタイルです。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

スタイルは、〜スタイルです。

冗長なので

計算した結果です。

くらいで良い。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完全に CSS ルールの競合が解決され

この語順も、「頭が赤い魚を食べる猫」に片足突っ込んでる。

CSS ルールの競合が完全に解決され


後日詳細に解説しますが、 Actual Value の導出には、多くの競合解決・計算過程を経ることになります。

その内の Cascade というステップで利用するアルゴリズムが、仕様でいうところの「[Cascade Sorting Order](https://www.w3.org/TR/css-cascade-4/#cascade-sort)」です。Cascade Sorting Order によって、 [Cascaded Value](https://www.w3.org/TR/css-cascade-4/#cascaded) が導出されます。Cascaded Value は、Cascade Sorting Order によって CSS ルールの競合が解決された状態の値を指します。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

その内の Cascade というステップ

この書き方をするなら、「多くの計算過程」の解説を後回すのはいいとしても、「ステップの一覧」だけ出しておいて、そのなかの "Cascade" だけここで話す、みたいにしてもよさそう。


CSS Cascading and Inheritance Level 4 時点での Cascade Sorting Order を図解すると、以下のようになります。

![alt text](../../../../assets/images/the-cascade.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alt text


ここでは特に完璧な HTML レンダリング結果のスタイルを得ることは目指していませんので、この程度でやめておきますが、UA StyleSheet が HTML のレンダリング結果をどれだけ整えてくれているのか、おわかりいただけたのではないでしょうか。

UA StyleSheet がなければ、我々はもっと冗長で大規模なスタイルシートを書かねばならなかったと考えると、UA StyleSheet の存在が大きなものに感じられます。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

つい最近まで UA Style に文句言って、 Reset CSS で更地にすることしか考えてなかった人の発言とは思えないw

Copy link
Owner Author

@sakupi01 sakupi01 Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

いや〜、ありがたいです www
reset は opinionated な感じあるんで、 一旦 normalize 更地勢なとこはありましたね

@vercel vercel bot temporarily deployed to Preview – git-kusa July 15, 2025 15:41 Inactive
@sakupi01
Copy link
Owner Author

@Jxck
レビューありがとうございます!
修正しました。
遅くなりすみません orz

Copy link

cloudflare-workers-and-pages bot commented Jul 15, 2025

Deploying studiosakupi01com with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ca4582
Status: ✅  Deploy successful!
Preview URL: https://d9f2b162.studiosakupi01com.pages.dev
Branch Preview URL: https://feat-2025-advent-6.studiosakupi01com.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants