Live data from Hacker News

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

modern-css.com

181–190 of 318 posts

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

#181
post #26

Earlier quoted context omitted.

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

Mvc is why there's 3 languages: HTML CSS and JavaScript The separation is already there People have just failed to understand it

Then we surely don't need to add random additional elements to our Content, purely to properly layout the content right, which is the job of the View?

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

#182
post #166

Earlier quoted context omitted.

In my editor this looks like this, with an extension like Tailwind Fold or Inline Fold: Because Tailwind is so low-level, it never encourages you to design the same site twice. Some of your favorite sites are built with Tailwind, and you probably had no idea.

Ok, and how does it look when you want to read or edit the “classes”?

yeah, Tailwind feels to me like a "write-only" solution.

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

#183

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 rest can be done in a terminal. (...) The browser is a nightmare because it wasn’t architected to run applications.
Neither were terminals, which were not even designed with a screen in mind.

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

#184
post #58

Earlier quoted context omitted.

Ever heard of Django? ASP.NET? Most UI frameworks, including ASP.NET Core, Spring Boot (Java based framework), Ruby on Rails, and Django (Python) are all based on MVC.

Those are all stateless MVC over HTTP, which is a very different architecture from stateful MVC for long-lived UI. The latter was invented for Smalltalk by Trygve Reenskaug, and is far more relevant to front-end web. Stateful MVC uses Publisher/Subscriber (or Observer) to keep Views and Controllers up-to-date with changing Models over time, which is irrelevant for stateless MVC over HTTP. Plus, in stateful MVC the Vi…

Is the Controller not in a coupled pair with a View? We could imagine an interface where it could be completely separate (e.g. a kiosk TUI where stuff like "press 'r' for X" is displayed), but in the vast majority of UIs the View has state, and the Controller has to depend on that state (e.g. did this keypress happen with a text field focused). Sure, this is abstracted away via the UI framework and we operate on usually some form of event system.

But even then, I don't really see how we could have a non-coupled controller-view. In fact, I seem to remember that it was described in a similar way for Smalltalk even.

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

#185

Live demo for input:user-invalid does not work on my phone. It'd always been the same: those ugly patches of JavaScript were being added to maintain compatibility with all the browsers... That's why the newest CSS tricks were always out of reach for us

yeah, it doesn't work on desktop Firefox or desktop Chrome-based browser either.

That one is a dud. Most others work for me, though.

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

#186
post #158

Earlier quoted context omitted.

> we wouldn't have to adjust our HTML when we change the layout. You don't have to: https://csszengarden.com/

But for that designers should care about the limitations. But they don’t care. Not even about the more basic ones. I’m quite sure many of them don’t even know. Mainly, because their customers are not the one who code. I got many designs for websites where customers told me that they want a pixel perfect version. The funniest one was when my boss who supposed to be a “senior” web developer told me this. Of course, the…

This doesn't solve the problem but:

If the designer is not aware of the ins and outs of the medium they are supposedly working with, they are not a very well informed and educated designer.

Just like I don't presume to be able to make a great product packaging design, without knowing firstly much more about visual composition and design, but also secondly the material and form and shape I am designing for. Will that be a plastic wrapper, a paper wrapper or some cardboard packaging? Without knowing the limitations and properties of each, how can I expect to create a good design?

Being that uninformed to me seems like not giving a shit about the quality of work one delivers, ergo not giving a shit about ones job, or simply not having the required understanding or skill to be any good at ones job.

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

#187
post #119

Earlier quoted context omitted.

I do sympathise as someone who has to scrape content from time to time, but that doesn't sound like a problem for the author of the content or something that impacts their intended user.

that's a problem for accessibility too

No, it really isn’t. Use of Tailwind has no bearing on the semantics of your HTML. You’re conflating two completely different things.

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

#188
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.

I do not work frontend and yet, I always end up having to do some CSS here and there.

I have never been happy on how I manage CSS. With tailwind, I am still unhappy about my styles but I can make my ugly UIs faster.

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

#189
post #43

Earlier quoted context omitted.

The deadest horse in web development is the myth of “separation of concerns”

I don't use Tailwind, it's a solution to a problem I don't have. I can understand how it might be useful for certain types of web development, e.g. landing pages where the content and styles are tightly coupled. So as a technology, it's OK. But my god its userbase is toxic and obnoxious.

Okay. I personally don’t care for anyone so chronically online that they think that their interactions with other similarly chronically online people is at all representative of the userbase of something as immensely widely used as Tailwind.

Whatever the professional equivalent of ‘touching grass’ is, I suggest you do that at your earliest convenience.

What an absurdly absolutist statement.

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

#190
post #9
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.

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

What stops you from doing the same thing in CSS? It is trivial to assign a specific CSS class to an element that is the root node of a "component" and scope rules under that.
Post reply on HN