Class Warfare - Can I Eliminate CSS Classes From My Html?
Posted4 months agoActive4 months ago
shkspr.mobiTechstory
calmmixed
Debate
20/100
CSSHTMLWeb DevelopmentSemantic Web
Key topics
CSS
HTML
Web Development
Semantic Web
The article explores the idea of eliminating CSS classes from HTML, sparking a discussion on the trade-offs between semantic HTML and the practicalities of styling complex web applications.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
17m
Peak period
1
0-1h
Avg / period
1
Key moments
- 01Story posted
Sep 19, 2025 at 9:09 AM EDT
4 months ago
Step 01 - 02First comment
Sep 19, 2025 at 9:26 AM EDT
17m after posting
Step 02 - 03Peak activity
1 comments in 0-1h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 19, 2025 at 1:46 PM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45301289Type: storyLast synced: 11/17/2025, 4:05:58 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
textarea { color: red; }
textarea.disabled { color: gray; }
Aiming for full semantic html and applying styles at the tag level _is_ good, but this seems like a not-very-useful refactor which has only made the code more rigid /2c
If a textarea is disabled there's no need to add a class.
textarea {background:red;} textarea[disabled] {background:gray;}
Could also be generalized as: [disabled] {background:gray;} or forms specifically: [disabled]:is(textarea, input, select, button) {background:gray;}