
Why I spent years trying to make CSS states predictable
The article discusses the challenges of managing CSS states and the complexity that arises when multiple states overlap. It introduces a tool called Tasty, which aims to simplify the process by allowing developers to define component states declaratively. This approach eliminates selector conflicts and makes extending components easier.
- ▪CSS states can become complex when multiple states overlap, leading to conflicts.
- ▪The author developed a tool called Tasty to express component states as a map, simplifying selector logic.
- ▪Tasty compiles state maps into unambiguous selectors, preventing conflicts and easing component extension.
Sidebar.io files mainly under design. We currently carry 33 of its stories.
Story provenance
Source · retrieval · rights · ranking — open for full record
inspect →
Story provenance
Attribution is not the same as permission. This drawer separates discovery metadata, excerpts, WeSearch-generated summaries, reuse status, and whether the publisher receives the visit. Nothing here claims a legal grant the publisher has not made.
Record
| Original publisher | tenphi.me |
| Canonical URL | https://tenphi.me/blog/why-i-spent-years-trying-to-make-css-states-predictable/ |
| Publication time | Fri, 22 May 2026 04:04:00 GMT |
| Retrieval time | 2026-05-21T09:21:10.393Z |
| Last seen | 2026-05-21T09:21:10.393Z |
| Headline source | Publisher (no WeSearch rewrite) |
| Excerpt source | publisher body |
| Excerpt method | First ~120 words (~800 chars) of extracted publisher body, fair-use limited. |
| Summary | WeSearch · cerebras-chat (WeSearch summarizer) |
| Summary source text | contentText |
| Citation coverage | Summary is a WeSearch-generated derivative; primary citation is the original publisher URL. |
| Cluster | 9x_QkUvB2f25 |
| Cluster logic | Grouped by semantic title/content similarity across sources within a rolling window. Same-publisher template collisions are excluded from coverage comparison. |
| Ranking reason | Story pages are not engagement-ranked. Hub feeds use recency, with optional source-diversified chronological ordering (cap consecutive stories per source). No personalized ranking. |
| Publisher visit | Yes — open original |
| Substitutes article? | No — link-out required for full text |
Rights status (four layers)
WeSearch handling by dimension
| Indexing | May the item be indexed (stored, ranked, made findable)? | Allowed |
| Snippet | May a short excerpt of the publisher's text be shown? | Allowed |
| AI summary | May WeSearch generate its own short summary of the article? | Limited |
| Retrieval / RAG | May the content be exposed for third-party retrieval-augmented generation? | Not asserted |
| Model training | May the content be used to train AI models? | Not asserted |
| Commercial reuse | May the content be reused commercially? | Not permitted |
Basis: Derived from the published RSS/Atom feed. Contact: [email protected]. Reviewed: 2026-07-24.
Opening excerpt (first ~120 words) tap to expand
Apr 23, 2026 · 8 min read Why I spent years trying to make CSS states predictable csswebdevfrontenddesignsystem Have you ever changed the order of two CSS rules and broken a component without changing the logic? .btn:hover { background: dodgerblue; } .btn[disabled] { background: gray; } Both selectors have specificity (0, 1, 1). When a button is both hovered and disabled, the browser falls back to source order. If the :hover rule comes last, the disabled button turns blue. If the [disabled] rule comes last, it stays gray. That sounds small, but it points to a bigger problem: component state in CSS often works by overlap. As long as a component has only one or two states, that overlap feels manageable.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at tenphi.me.