News for hackers. Stuff that matters.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by tobr on Thursday March 18, 2021 @12:07PM (#26504115)
Good reminder that in CSS, darkgray is a light gray and gray is a dark gray. Also presumably up is down and wet is dry.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by munificent on Thursday March 18, 2021 @12:49PM (#26504657)
CSS is just an embarrassment of mistakes:

   white-space: nowrap
So they take a word "whitespace" which needs no hyphen and jam one in. Then they take two completely distinct words "no wrap" and jam them together with no separator. And then you have to remember both of these on the same rule.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by tshaddox on Thursday March 18, 2021 @02:14PM (#26505681)
Also, the entire semantics are a bit strange. When I'm deciding whether I want text to line wrap, I don't really think about whether the whitespace should wrap. Yes, whitespace is somewhat relevant to the topic, since that's one option of where to break lines in order to line wrap, but I still think of it as the entire text that is line wrapping.

Oh, and don't forget that there is in fact a word-wrap property, which is a much better name for the previous behavior, but in fact only customizes how the line-breaking algorithm determines which words can be broken apart.

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by frivoal on Thursday March 18, 2021 @11:24PM (#26509907)
The naming is far from great, but there is a method to the madness. Here's a talk I did a while back on how various line breaking things fit together: https://cssday.nl/2019/speakers#florian
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by runarberg on Thursday March 18, 2021 @02:26PM (#26505833)
This is at the top of the list in the Incomplete List of Mistakes in the Design of CSS[1]. Which has been discussed several times on HN (last 2 months ago)[2].

1: https://wiki.csswg.org/ideas/mistakes

2: https://news.ycombinator.com/item?id=25891435

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by IncRnd on Thursday March 18, 2021 @03:51PM (#26506802)
"Whitespace" in programming languages is a single word. "White space" in visual arts is composed of two separate words.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by ericwood on Thursday March 18, 2021 @02:15PM (#26505685)
Eh it's minor at best. I'll take it over "referer" any day.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by Waterluvian on Thursday March 18, 2021 @06:44PM (#26508337)
I would be so lost if vscode didn't autocomplete css so well for me.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by joegahona on Thursday March 18, 2021 @01:39PM (#26505313)
"White space" is two words, not one.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by tshaddox on Thursday March 18, 2021 @02:22PM (#26505772)
In computing it is widely used as a single word "whitespace." For example:

- The XML W3C Rec: https://www.w3.org/TR/xml/

- The HTTP 1.0 RFC: https://tools.ietf.org/html/rfc1945

However, there are exception. The Unicode character database has a property called "White_Space" which implies it is two words: http://www.unicode.org/reports/tr44/#White_Space

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by nanis on Thursday March 18, 2021 @03:19PM (#26506441)
> a property called "White_Space" which implies it is two words

<tongue-in-cheek> Except that `_` is a "word" character by default. </tongue-in-cheek>

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by tobr on Thursday March 18, 2021 @02:22PM (#26505769)
As far as I can tell, both are common, but “white space” is more common as a synonym to negative space, and “whitespace” is more common to refer to the characters. If so, the “white-space” property controls whitespace, not white space.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by scubbo on Thursday March 18, 2021 @02:56PM (#26506200)
"White" and "space" are two words, and "Whitespace" is one word.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by achairapart on Thursday March 18, 2021 @01:17PM (#26505042)
But 'chucknorris'[0] is still my favorite red.

[0]: https://stackoverflow.com/questions/8318911/why-does-html-th...

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by synn on Thursday March 18, 2021 @05:35PM (#26507813)
That's fun. I've coded this useless tool based on your comment: "What's Your HTML Color ?"[0]

[0]: https://onivers.com/color.html

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by achairapart on Thursday March 18, 2021 @05:48PM (#26507912)
Ah! Maybe useless but cool nonetheless!
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by smoe on Thursday March 18, 2021 @02:29PM (#26505861)
This just reminded me of the first bug of my career that took me hours trying to figure out. Colors weren't working correclty in IE 6 (pre IE Developer Tools) and I eventually learned that Firefox accepted both spellings "gray" and "grey", whereas IE only one of them.

Don't remember which one I used, but do remember that I went home early that day after that :/

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by yreg on Thursday March 18, 2021 @12:38PM (#26504526)
Fiddle if anyone wants to see them: https://jsfiddle.net/yucsj7a2/1/
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by cialowicz on Thursday March 18, 2021 @12:37PM (#26504518)
'Brown' is dark red, and to my eye 'sienna' has very little red in it. To get actual brown, you need 'saddlebrown'. CSS is super weird.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by SamBam on Thursday March 18, 2021 @12:52PM (#26504699)
"Sienna" is an extremely ambiguous color already. Image search for "sienna color" and you'll get a huge range of browns, reds and oranges.

"Burn sienna" seems even more varied. Here's are four different color-oriented websites, with a dark earthy orange from Colorlex [1], a light salmon from Canva [2], a light brown from Benjamin Moore [3] and a dark brown from Atelieracrylic [4].

1. https://colourlex.com/project/burnt-sienna/ 2. https://www.canva.com/colors/color-meanings/burnt-sienna/ 3. https://www.benjaminmoore.com/en-us/color-overview/find-your... 4. http://atelieracrylic.com/atelier-interactive/burnt-sienna/

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by cialowicz on Thursday March 18, 2021 @01:20PM (#26505073)
Fair enough, but the 'brown' issue is similarly confusing to the lightness reversal between 'gray' and 'darkgray'.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by SamBam on Thursday March 18, 2021 @01:20PM (#26505075)
Agree on the brown front, it's a very odd color choice.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by avianlyric on Thursday March 18, 2021 @02:42PM (#26506012)
Worth watching the Technology Connection video on the colour Brown [1]. It's a strange colour that only really exists when placed in the context of other colours, not something that can really be produced by a pure RGB light source, which explains why the CSS Brown colour looks red.

[1]: https://www.youtube.com/watch?v=wh4aWZRtTwU

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by buzzerbetrayed on Thursday March 18, 2021 @01:40PM (#26505332)
I tried to find brown on the slider to see what you’re talking about. Took me ages. Turns out you have to go REALLY red in order to find brown.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by runarberg on Thursday March 18, 2021 @02:35PM (#26505927)
Turns out brown is a really interesting color: https://www.youtube.com/watch?v=wh4aWZRtTwU
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by mceachen on Thursday March 18, 2021 @02:08PM (#26505609)
Yup. There's a bunch like that.

Know that CSS colors mostly came from X11: https://en.m.wikipedia.org/wiki/X11_color_names

The CSS team shares some blame, though: they adopted them (and they really didn't need to: they could have just supported rgb/hsb/lab triplets).

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by achairapart on Thursday March 18, 2021 @02:59PM (#26506235)
Some background about why dark gray is lighter than gray, plus some other idiosyncrasies:

https://en.wikipedia.org/wiki/X11_color_names#Clashes_betwee...

Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by seabass on Thursday March 18, 2021 @07:52PM (#26508844)
And lavender is definitely not lavender.
Re:Show HN: Sorted CSS Colors – Sort the named CSS colors in... by knuptfad on Thursday March 18, 2021 @12:11PM (#26504166)
¯\_(ツ)_/¯