Live data from Hacker News

Incomplete List of Mistakes in the Design of CSS

wiki.csswg.org

151–154 of 154 posts

Re: Incomplete List of Mistakes in the Design of CSS

#151

Earlier quoted context omitted.

From the beginning, CSS tutorials said just what you said, that the web is not the printed page and that you should not strive for pixel-perfect layout.

It's not necessarily about pixel perfect. Even basic things like "two divs horizontally" are not intuitive in CSS, especially pre-flex-box.

  div { display:inline-block }
was that really so hard?

Re: Incomplete List of Mistakes in the Design of CSS

#152

Earlier quoted context omitted.

For #5 use rem which is based off the document font-size rather than the current elements font size. What really needs to stop is the use of pixels and absolute font sizes for sizing everything as they never work on more than 1 device/zoom level/default font size. Breaking layout into its own thing has its ups and downs. Basically you would have to break out what flexbox and grid do into a "layout" file, and come up…

rems don't work either because there are instances where you need to have things line up exactly. For example, if you have 3 columns. You will be one pixel out. There are no good ways to fix this. See [0] https://johnresig.com/blog/sub-pixel-problems-in-css/ CSS should only be used to appease those ppl in your org that read/write more blog posts than code. Use JS if in doubt. You're welcome.

I tried and failed to recreate that example (from 2008). Modern browsers do seem to do a reasonable amount of sub pixel rendering. Maybe rems are bad but that article does not demonstrate it.

Re: Incomplete List of Mistakes in the Design of CSS

#153
post #37

Earlier quoted context omitted.

If that's a serious problem for you, setup your vim to use a different color for variables based on the current filetype.

It’s not a serious problem to work around, but it is another instance where the web architects designed all these different languages without thinking all that deeply about how they would work together. and so i need .style[“background-color”] .style.width=mywidth+”px” and (sigh) href=“/search?q=hello%20world&another=query%20parameter” the latter of which is, while it's the correct way to write html, is so stupid…

El.style.backgroundColor = Foo;

That works. Js automatically allows use by camelCase.

Re: Incomplete List of Mistakes in the Design of CSS

#154

Earlier quoted context omitted.

rems don't work either because there are instances where you need to have things line up exactly. For example, if you have 3 columns. You will be one pixel out. There are no good ways to fix this. See [0] https://johnresig.com/blog/sub-pixel-problems-in-css/ CSS should only be used to appease those ppl in your org that read/write more blog posts than code. Use JS if in doubt. You're welcome.

I tried and failed to recreate that example (from 2008). Modern browsers do seem to do a reasonable amount of sub pixel rendering. Maybe rems are bad but that article does not demonstrate it.

Did you try it on ie11? That was the only one we experienced it on. Of course we had to support ie, which meant a layout re-write. :<
Post reply on HN