Live data from Hacker News

Modern CSS Code Snippets: Stop writing CSS like it's 2015

modern-css.com

21–30 of 318 posts

Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015

#22
post #13
post #9

Earlier quoted context omitted.

Yeah let's do that. You have everything related to your component on place instead of jumping between files.

Is jumping between files supposed to be difficult or something?

Without a lot of discipline it is very easy to end up with a css with lots of unclear and hard to guess effects. Eg consider the case of where A and B are complex templates. Any selector with the " " operator on A risk expanding to the inner A even if it was intended only for the outer. Similarly a :has selector might catch a descendant of the wrong element.

@scope fixes a lot of this, but it is a complex problem. With tailwind you mostly have to worry about inheritance

Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015

#23
post #13
post #9

Earlier quoted context omitted.

Yeah let's do that. You have everything related to your component on place instead of jumping between files.

Is jumping between files supposed to be difficult or something?

Is staying in one file supposed to be difficult or something?

Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015

#25
post #4

CSS in 2025: Let's write html inlined styles as if it was 2005 and separation of formatting/representation was never invented. I talk of tailwind, of course.

Wait until you see React & JSX... At least html and CSS are both presentation. React/JSX now confuses presentation and business logic.

> React/JSX now confuses presentation and business logic

React was originally designed to be the "V in MVC". You can still use it that way. React becomes very simple when you only use it as the V in MVC.

Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015

#26

Earlier quoted context omitted.

Wait until you see React & JSX... At least html and CSS are both presentation. React/JSX now confuses presentation and business logic.

> React/JSX now confuses presentation and business logic React was originally designed to be the "V in MVC". You can still use it that way. React becomes very simple when you only use it as the V in MVC.

What are the M and the C, and how do they talk to the V in this case?

Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015

#27
post #26

Earlier quoted context omitted.

> React/JSX now confuses presentation and business logic React was originally designed to be the "V in MVC". You can still use it that way. React becomes very simple when you only use it as the V in MVC.

What are the M and the C, and how do they talk to the V in this case?

- M for Model: your data model. - V for View: views of your data. - C for Controller: does stuff with your data.

Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015

#28
post #26

Earlier quoted context omitted.

> React/JSX now confuses presentation and business logic React was originally designed to be the "V in MVC". You can still use it that way. React becomes very simple when you only use it as the V in MVC.

What are the M and the C, and how do they talk to the V in this case?

react can be pure functions that take in props. Given a set of props, ideally data primitives, the outputted view is guaranteed. it's nice.

In practice, the entire JS ecosystem enjoys flying off the rails, every season, but it's not strictly react's fault.

To answer your question, however those props get into the component is up the the M & C. can be async server, or shoved in as json in the script tag.

Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015

#29

CSS is the only thing from browsers we actually need. The rest can be done in a terminal. Contemporary terminals could even render the UI with way less memory. The browser is a nightmare because it wasn’t architected to run applications.

> The browser ... wasn’t architected to run applications.

Could you explain this? What prevents the browser from running applications? How should it have been architected otherwise if running applications was the goal?

Re: Modern CSS Code Snippets: Stop writing CSS like it's 2015

#30
post #4

CSS in 2025: Let's write html inlined styles as if it was 2005 and separation of formatting/representation was never invented. I talk of tailwind, of course.

Wait until you see React & JSX... At least html and CSS are both presentation. React/JSX now confuses presentation and business logic.

React is great for MVVM indeed. Who is still using MVC in 2026?
Post reply on HN