Live data from Hacker News

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

modern-css.com

141–150 of 318 posts

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

#141
I hate how it's still not possible to properly style the numbers in ordered lists.

I use them for code snippets with automatic line numbers, but it's literally impossible to space the numbers (relative to the code) while keeping them aligned to the right. ¯\_(ツ)_/¯

https://jsfiddle.net/89t1rd2u/

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

#142

I dislike the examples here where the "old" way works in all browsers, but the "new" way only works in Chrome/Edge. IMO, it's irresponsible to include such examples, since it makes the Blink monoculture worse.

Sometimes I'm developing an internal tool or something only for myself / handful of people. I'm perfectly fine saving time and complexity using a one liner modern CSS solution instead of having to rely on some hacky unreadable code to support 10 years of legacy browsers.

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

#144
post #55

Earlier quoted context omitted.

You have any more sources on MVVM being a mistake? I found WPF rather nice to work with. Same with knockout.js and Angular I don’t see much downsides. Everyone can write bad code of course in each of them but I think it was working quite well.

When React launched in 2013, its defining idea was strict one-way data flow: parents pass data down via props, and updates happen in a clear, explicit place. Children can't mutate parent state directly; they signal changes through callbacks. The result is predictable, traceable state changes. This contrasted with MVVM frameworks like early AngularJS, Knockout, and WPF, which relied on two-way data binding. That autom…

Thanks GPT but I know all of that. I was expecting some eye opening new evidence because person I was asking seemed really confident and using strong words.

But that’s just generic „blablabla”. MVVM is not a mistake and is still plenty useful.

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

#145
post #62
post #55

Earlier quoted context omitted.

You have any more sources on MVVM being a mistake? I found WPF rather nice to work with. Same with knockout.js and Angular I don’t see much downsides. Everyone can write bad code of course in each of them but I think it was working quite well.

Isn't Vue also MVVM?

Yes VUE is quite a descendant of knockout.js.

People confidently write strong opinions on the internet.

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

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

Vue, Svelte, and Surface manage to do this without forcing you to inline all your styles

I worked with both. Scoped styles are nice. Tailwind is better - no naming of every element, no mental tax of jumping around in the file -

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

#147
In case the author happens to read these - final statement in native CSS nesting is no longer true.

"The only small difference from Sass: for element selectors you need the & prefix. In Sass you could write a { color: red } inside a parent, but native CSS requires & a { color: red }."

It was true for a bit, but fixed within 2-3 releases iirc. You can now freely nav { a { color: red; } }

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

#148
post #126

Earlier quoted context omitted.

Obfuscate? I can learn tailwind and use it in dozens of projects. I can use tailwind in my project and onboard dozens of developers immediately. I can learn your CSS conventions and use them in exactly one project.

Why can you use CSS conventions in only one project?

He wrote "learn your CSS conventions" which implies that every team and every project will have a different set of conventions. Hidden inside that statement is the fact that he just accepted that Tailwind should be THE CSS convention, something I personally disagree with but to each their own.
Post reply on HN