Live data from Hacker News

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

modern-css.com

291–300 of 318 posts

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

#291
post #290

Earlier quoted context omitted.

> If everything in your code is a React component, I get why you would just want to write the styles right there. Even for keeping the style close to the component, you can just use standard css. Create a folder Button, create two files Button.tsx and Button.css in that folder, import the css file in the tsx file, add a class "button" on the first element the tsx file renders, start all the rules in the css file with…

if you're not using CSS modules, why would you import the css file into your javascript? But anyway, I think we agree. Feel free to read the linked blog post ;-)

Yes we agree, my comment was for tailwind users. :) I was replying to you because you gave the example of a Button component, and it's a good example to demonstrate that you don't need tailwind to style components.

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

#293

Earlier quoted context omitted.

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

> The separation is already there I wonder how you would map these three onto M, V, and C :-)

In the late 1990s there were a number of working groups for the w3c who were very familiar with the MVC paradigms.

Out of those multi-year-long working groups came cascading style sheets and their revisions along with JavaScript features like dom access.

The dominant paradigm is to let their work go unread and call it a flex.

I've frequently been belittled and mocked in online negging when I encourage people to take a deep dive and learn something new.

I'm not here to debate people who think mockery and dunking on people that have done hard work is good faith behavior

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

#294

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/

CSS Zen Garden is quite the opposite of a good example of your point. Even small changes to the original page layout would completely break most of the provided styles. If I removed the .page-wrapper class it would be also nearly impossible for a different developer to reverse-engineer the issue from the existing Template and CSS files.

Yes, if you remove CSS it does tend to break the CSS.

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

#297

Earlier quoted context omitted.

Also broken on latest Safari & iOS. They should add screenshots how it supposed to look

however, it would defeat the purpose of the live demo...

They can have both like MDN...

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

#298
post #237

Earlier quoted context omitted.

"widely available" has a precise meaning that includes Firefox (both desktop and Android). it might be irrelevant for some, but let's not twist industry definitions

Based on marketshare, Firefox can easily be excluded from "widely available"

This website says certain features work on firefox. But they don't. You can disregard firefox if you like. But if this "Modern CSS Code Snippets" website explicitly tells me their snippets work in firefox, I expect the snippets to work in firefox. Many of them do not.

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

#299
post #231
post #217

Earlier quoted context omitted.

Wait until sites start rendering to canvas. You will yearn for the days of div soup.

why should they? this has been a worry for some time, but I don't see it happening

I thought it was being done for web apps like Google Docs now, and I thought one of Microsoft's cross-platform toolkits used too (though I don't think this toolkit itself will see broad adoption).

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

#300
post #275

Earlier quoted context omitted.

As much hate as it gets, this is one thing I like about Angular.

imo Angular would have won had it figured out a stronger path from v1 to v2

Angular is pretty decent in that it gives you everything you need (the concept of a page and routing, services etc) but one thing I'll give React is the simplicity of changes to attributes just triggering updates.
Post reply on HN