3 ms·
All the problems he listed are very real, and its important that a technology fit in our actual working model, not just some theoretical model. Take his exampl
by blacktriangle 5y ago
All the problems he listed are very real, and its important that a technology fit in our actual working model, not just some theoretical model.
Take his example of the images being off thus screwing up your widths because you chose to inherent the image width as a constraint. Now imagine a very realistic scenario where you are reusing that style across multiple pages, and each page has a different image. Now you need to confirm this works for all existing and future possible images, good luck with that.
Point being, isolating element styles from each other where possible is a big win for maintainability and reliability.
- berkes 5y agoThe 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 achieve the desired result. Step back here is seeing that large images in certain containers push the container out and that you want to avoid this. If you want CSS to avoid the problems you list, in the first place: that is just unconstructive: The tooling, holiday schedule, poor migrations, and broken upgrades are causing the issues, the constructive solution would be to fix those. And if you cannot, to look at how CSS can help you with them. > Now you need to confirm this works for all existing and future possible images, good luck with that. This is not hard at all. It is what both the C in CSS and classes and inheritance solve for you. `img.leader` vs `img.aside` vs `article p.teaser img` vs `article img` etceteras.
- blacktriangle 5y agoExpecting 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 so are you in your last line, that the solution is to hardcode those images and decouple the two components. You can say don't blame CSS as it gives you a multitude of options for how to deal with the situation, but the counterargument is that good tools lead you to a "pit of success" where the correct way is obvious, and CSS is more like a "tiny little bridge out of Moria of success" where you're just asking to fall to your doom.
- hypertele-Xii 5y agoCSS 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.
- blacktriangle 5y agoCSS is designed for professionals is the biggest ret-con I've ever heard. How much effort have developers spent adding basic functionality like scoping, modularity, and variables, features that are table stakes for any "professional" system? CSS was very much designed for amatures at the expense of professionals. Second, to call CSS simple is insane. How many ways are there to create a positioning root? How many ways to create a stacking context. How many different things can using '%' as a unit mean in different context? CSS is incredibly complex. CSS tries to shove these important concepts implicitly away from the developers notice, only to ultimately make life worse for both amatures and pros.