Live data from Hacker News

My First CSS

engineering.kablamo.com.au

81–90 of 107 posts

Re: My First CSS

#81
post #74

Earlier quoted context omitted.

The problems may be real, but blaming CSS for them is both unfair and unconstructive. You want CSS to solve this problem that other tools and workflows introduce? `article .content img { width: auto; display: block; max-width: 100%; }`. This is not the solution, but one of many possible. > ... step back and understand where its current width is coming from, and determine how that flow can be shifted upstream to achie…

Expecting CSS to solve people on holiday is not the point, but expecting a technology to protect me from the much more general problem of other developers and content generators making mistakes is something I think you can blame on CSS. Going back to brundolf's point, he's arguing that you should try and take advantage of relative constraints as much as possible as CSS lets you do that. I'm arguing the opposite, and…

CSS is not a technology designed nor intended to protect you from anything. It's a technology that enables professionals to style web pages.

And it's simple enough that even amateurs can accomplish much.

Re: My First CSS

#82
post #26
post #7

Earlier quoted context omitted.

> it's just an indication that the author chose to dive in without understanding the fundamentals first You'd be surprised how many otherwise-competent engineers don't take CSS seriously enough to seek out the fundamentals, and instead spend their days avoiding it as much as possible and cursing it when they can't

I totally avoid CSS at work because it’s just an insane whack-a-mole spaghetti based upon our own SASS framework written by a few designers that had to learn CSS without any mentoring (since they are in their own « design » team), and don’t understand the consequences of what they do. So yes, I totally spend my days avoiding it. Not because I hate CSS (I love it in some way, and I miss writing elegant stylesheets) bu…

I'll agree that it's a delicate tool. Similar to Lisp, CSS is very elegant in the right hands but also heavily reliant on the devs sticking to strong conventions and principles. On solo projects, or projects with just a couple of devs, it can be wonderful. But it does tend to have trouble scaling.

Which is why, even though I don't love them, I respect the usefulness of things like CSS Modules that impose more scoping and constraint over CSS codebases. For bigger teams they do tend to be necessary.

Re: My First CSS

#83

For me those rules are not the fundamentals. There's more you need to know to actually get CSS to work (and I still usually have to guess and google and try random things to get it to work because my knowledge is lacking) In particular trying to get content of some flexbox to fill the space provided by the flexbox itself, especially in a single non-scrolling app like page where you're trying to constrain everything t…

It's what I do with a small language I'm working on, for instance http://lambdaway.free.fr/lambdawalks/?view=splash2

More can be seen on the lambdatalk language in http://lambdaway.free.fr/lambdawalks/?view=coding

Re: My First CSS

#84
I think these are most of the guiding principles that I wish I understood a lot sooner than I actually did. I spent a lot of time fumbling around, tweaking CSS back and forth, and not really understanding why things weren't behaving as expected.

Re: My First CSS

#86

I've known those things listed for 15 years now, and they did not help with the wack-a-mole problem. Especially not when working with multiple people. The only thing I've found to actually work is to keep things as simple as possible when it comes to your actual stylesheet. Any kind of complexity including some core CSS properties (e.g. the C for cascading) I avoid. My second box .foo is only slightly different so I…

I've also found atomic css, such as Tailwind, largely eliminates this problem. Yeah, a controversial opinion, but regardless of how you feel about utility classes, they do avoid this problem.

Re: My First CSS

#87
post #30

Earlier quoted context omitted.

I think there is a very easy fix to most HTML/CSS problems when building GUI on the web - use HTML5 canvas. HTML is not a good match for GUI and CSS is not a good match for...anything. HTML5 canvas brings you to where Windows/X was 25 years ago so instead of trying to build GUI using TUI, just use the damn GUI already. Sure, the whole lot of tooling is missing but some copy/paste/fix from either Windows or X should p…

Canvas doesn't bring you do Windows/X11, Canvas brings you to a basic VESA driver where you're plotting pixels manually. You think the JS framework churn is bad now when all of those frameworks are just layers over HTML, just imagine the world we're looking at if everybody is writing their own full GUI framework to work with canvas. At least with JS framework hell everything is guarenteed to have the same output form…

> HTML5 and CSS are just bad tools for doing GUIs

Is there something better? With Qt Widgets, the poster child for cross-platform GUI toolkits, I also frequently have problems with getting the layout to behave the way I want.

Re: My First CSS

#88
Looking at the site, I'd say that some of the information are well described. Still, a lot of people get confused on the box model might as well on the flex box, grid and manipulating transitions and animations.

Re: My First CSS

#89
the only thing IE ever got right was treating box-sizing: border-box as the default. I work with CSS all the time and have no idea after all these years why anyone would want to base it on content size if they plan to use any padding at all.
Post reply on HN