The web is being reworked to display a rainbow of previously unavailable colors, but part of the transition demands abandoning commas for spaces when coding CSS color-space parameters.
Word of the new cruelty went out via Twitter on Thursday when Mathias Bynens, who works on Google's Chrome team, advised web developers to adopt "the modern comma-free CSS color syntax."
The reason, he explained, is that modern CSS color display functions, specifically lab(), lch(), and color(), don't work with commas. These functions provide different ways to express color values.
CSS, short for Cascading Style Sheets, is a domain-specific declarative programming language for laying out web pages, usually in conjunction with HTML and JavaScript. It has used commas since its first appearance in the mid-1990s, and it continues to do so.
But CSS is evolving, and since 2016 there's been an effort spearheaded by Tab Atkins Jr, a developer on the Google Chrome team, and Elika Etamad (@fantasai), a member of W3C CSS Working Group and a Mozilla contributor, to get rid of unnecessary commas in CSS code related to color.
The rationale for doing so is consistency, though not everyone endorses the idea. Commas have a specific role in CSS.
"In CSS, functions are a just a way to group/name a syntax chunk, so they should work by the same rules that CSS grammar does in general: values are optional and re-orderable when possible, space-separated, and commas are used to separate *repetitions* only," Atkins wrote in a Twitter post.
The syntax for rgb() and rgba() violates this rule, he said. And in the color() function, there are different color spaces that can take a different number of values, making it difficult to know whether the final number refers to color or alpha (opacity).
Support for the comma-less syntax made its way into CSS Color Module Level 4, which became an official part of the CSS specification last year, and it's now being baked into various web browsers.
"Some parts of it have been implemented earlier than others: the comma-less syntaxes are widely supported now, limited forms of the color() function are supported in [WebKit], and the more advanced color functions (lab(), lch(), the rest of color() + @color-profile) will be coming to all browsers as they continue to improve their handling of wider and deeper color gamuts," explained Atkins via Twitter DM.
The color gamut refers to the range of available colors in a particular color space. One such color space is sRGB, used on the web to define colors in terms of red, green, and blue values ranging from 0 to 255.
There are other color spaces like Display-P3 that define a wider range of colors, about a third more than sRGB. Modern monitors can display these colors but web developers can't specify them in CSS using the traditional comma-separated syntax.
In a post earlier this month, Lea Verou, a doctoral student in computer science at MIT and member of the W3C CSS Working Group, described the situation thus:
"CSS right now cannot access these colors at all. Let me repeat: We have no access to one third of the colors in most modern monitors. And these are not just any colors, but the most vivid colors the screen can display. Our websites are washed out because monitor hardware evolved faster than CSS specs and browser implementations."
The CSS functions for displaying these more vivid colors are making their way from specification to browser. Apple's WebKit browser engine introduced support for Display-P3 in 2016, and was still the only browser engine to support it as of January 2020. But Safari, Chrome, and Firefox are working on their respective implementations.
Once the capability to display wide gamut color spaces arrives in browsers, space-separated, comma-less CSS will be required. Hence, the call to drop commas in CSS color code.
Sponsored: Practical tips for Office 365 tenant-to-tenant migration
See the article here:
- Hang onto your hats--More Redheads RFL Shopping 🙂 [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Why I Relay -- from Daaneth Kivioq [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Two Upcoming Events! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- We had fun AND ... [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Why I Relay -- from Edith Halderman & Envy Watts [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Toga! Toga! We had fun and raised 5k for RFL! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- "Duel of the DJ's" --THIS Sunday, April 19 at 1pm [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Dressing for Relay Events... Lag in Style! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- "Duel of the DJ's" -- TODAY Sun, April 19 at 1pm [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Relay Shopping Made Easy! Our Very Own Store! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- We have a winner! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Not to Miss! Frogg & Jaycatt Saturday at 1pm SLT [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Thank You Frogg, Jaycatt, Lomgren and Luskwood! GO RELAY! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Upcoming Events in Redhead-land [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- In Memory of ... Lachlan Campbell [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- More Goodies in Our RFL Store [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- The BIG Blowout Event! 12-3pm SLT Tomorrow! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- ONE WORLD, ONE HOPE! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- We miss you Fimi! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Redheads Know How To Partay!!! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- We had a BALL! And the SILENT AUCTION continues... [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- RenFaire! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- Rocking With Yahshvah Shinja [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- WOW! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- What a weekend that was! [Last Updated On: November 8th, 2009] [Originally Added On: November 8th, 2009]
- 2010 Blog! [Last Updated On: April 4th, 2010] [Originally Added On: April 4th, 2010]
- Brian Scalabrine - The World's Greatest - Video [Last Updated On: March 29th, 2012] [Originally Added On: March 29th, 2012]
- Red strength hint in caution notice [Last Updated On: April 25th, 2012] [Originally Added On: April 25th, 2012]
- Emma Roberts turns heads at Coachella [Last Updated On: April 25th, 2012] [Originally Added On: April 25th, 2012]
- Cartoon of the Day: Chelsea's battered bus leaves Terry behind and heads for Munich after rolling over Barcelona [Last Updated On: April 25th, 2012] [Originally Added On: April 25th, 2012]
- Kaskade Heads Out On 'Freaks Of Nature' Tour, Gives Us Full-Body Chills (VIDEO) [Last Updated On: April 25th, 2012] [Originally Added On: April 25th, 2012]
- Red shirts divided over Prem meet [Last Updated On: April 25th, 2012] [Originally Added On: April 25th, 2012]
- Snobby Mr. Douchey - Ep: 6 - Video [Last Updated On: May 4th, 2012] [Originally Added On: May 4th, 2012]
- Ep. 3 MALLSCAPADE: Squaresville (A new free web show about growing up bored in the suburbs) - Video [Last Updated On: May 4th, 2012] [Originally Added On: May 4th, 2012]
- My Sisters: Problematic to Practically Perfect - Ep: 2 - Video [Last Updated On: May 4th, 2012] [Originally Added On: May 4th, 2012]
- Backstage Girls- Episode 2: Bobby Brown's Every Little Step - Video [Last Updated On: May 4th, 2012] [Originally Added On: May 4th, 2012]
- Red Heads for Red Heads with Cornelia Frances for The Orangutan Project - Video [Last Updated On: May 4th, 2012] [Originally Added On: May 4th, 2012]
- More Theatre of Life: Gay Witchcraft - Video [Last Updated On: May 4th, 2012] [Originally Added On: May 4th, 2012]
- Asian Red Head - Video [Last Updated On: May 4th, 2012] [Originally Added On: May 4th, 2012]
- Red Devils baseball team wins play-in game vs. North Sevier, heads to 2A tourney [Last Updated On: May 5th, 2012] [Originally Added On: May 5th, 2012]
- Ask Nick: Is something wrong with Gonzalez? [Last Updated On: May 5th, 2012] [Originally Added On: May 5th, 2012]
- Red Bluff Lady Spartans blast Lassen 13-0 [Last Updated On: May 5th, 2012] [Originally Added On: May 5th, 2012]
- Camelot heads 2,000 Guineas field [Last Updated On: May 5th, 2012] [Originally Added On: May 5th, 2012]
- Tech baseball heads to College Station for final time [Last Updated On: May 5th, 2012] [Originally Added On: May 5th, 2012]
- Joe Stortini heads list of local all-state basketball players [Last Updated On: May 5th, 2012] [Originally Added On: May 5th, 2012]
- 'White Rabbit, Red Rabbit' review: never the same [Last Updated On: May 7th, 2012] [Originally Added On: May 7th, 2012]
- Red sea of Clippers fans lifts team to win [Last Updated On: May 7th, 2012] [Originally Added On: May 7th, 2012]
- Reynolds and Hammel carry Orioles past Red Sox 8-2 [Last Updated On: May 7th, 2012] [Originally Added On: May 7th, 2012]
- Gillard, Abbott promote Red Cross [Last Updated On: May 7th, 2012] [Originally Added On: May 7th, 2012]
- The Duchess of Cambridge turns heads with glamorous cream dress [Last Updated On: May 10th, 2012] [Originally Added On: May 10th, 2012]
- Royals 4, Red Sox 3: Two out of three is bad [Last Updated On: May 10th, 2012] [Originally Added On: May 10th, 2012]
- The power of a sign [Last Updated On: May 10th, 2012] [Originally Added On: May 10th, 2012]
- Met Ball 2012 Red Carpet: Stars Shine In Metallic Frocks [Last Updated On: May 10th, 2012] [Originally Added On: May 10th, 2012]
- Morning Mail: Red Sox fan wears bag on head, starts social media storm [Last Updated On: May 13th, 2012] [Originally Added On: May 13th, 2012]
- 'Food Truck Wars' heads for Monmouth Park [Last Updated On: May 13th, 2012] [Originally Added On: May 13th, 2012]
- Obama to talk mortgages in Reno, Romney heads to North Carolina, plus more to watch for this weekend in politics [Last Updated On: May 13th, 2012] [Originally Added On: May 13th, 2012]
- Losing heads while salmon fishing [Last Updated On: May 13th, 2012] [Originally Added On: May 13th, 2012]
- West Ottawa boys track & field wins stunning relay at OK Red meet [Last Updated On: May 13th, 2012] [Originally Added On: May 13th, 2012]
- Sexy Redheads - Video [Last Updated On: May 13th, 2012] [Originally Added On: May 13th, 2012]
- Red Sox Look to Build Momentum Against Mariners: Fan Preview [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- Red-cockaded woodpecker gets care and protection in Alabama (with video and gallery) [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- Beckett takes Red Sox from Fenway to Bushwood [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- Greek uncertainty leaves US stocks in red [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- Greece Heads Toward New Elections [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- On Soccer: Red Bulls rise to top of Eastern Conference with help from trio of young American defenders [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- Frankel heads Lockinge confirmations [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- Kevin Spacey heads to South Africa for movie project premiere [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- Red Poppy brings new voices to art scene [Last Updated On: May 16th, 2012] [Originally Added On: May 16th, 2012]
- Gold Heads Into The Red In 2012 [Last Updated On: May 17th, 2012] [Originally Added On: May 17th, 2012]
- Betty White heads to Washington to see the animals [Last Updated On: May 17th, 2012] [Originally Added On: May 17th, 2012]
- Outdoors: Losing your heads against fishing rules [Last Updated On: May 17th, 2012] [Originally Added On: May 17th, 2012]
- Betty White heads to nation's capital to see National Zoo, indulge passion for animal watching [Last Updated On: May 17th, 2012] [Originally Added On: May 17th, 2012]
- Canadian wave heads to Cannes Film Festival [Last Updated On: May 17th, 2012] [Originally Added On: May 17th, 2012]
- Pippa Middleton Wears Sexy Red Dress at Scottish Wedding [Last Updated On: May 20th, 2012] [Originally Added On: May 20th, 2012]
- Touchdowns for a cure [Last Updated On: May 20th, 2012] [Originally Added On: May 20th, 2012]
- TSX heads higher; Facebook shares rise after delayed start of trading [Last Updated On: May 20th, 2012] [Originally Added On: May 20th, 2012]
- Woman heads to Uganda to bring cheer to children [Last Updated On: May 20th, 2012] [Originally Added On: May 20th, 2012]
- World Premiere of Disney•Pixar’s “Brave” Heads to Hollywood for Grand Opening of the Dolby Theatre [Last Updated On: May 20th, 2012] [Originally Added On: May 20th, 2012]
- Toronto stock market heads higher amid cautious buying at end of bruising week [Last Updated On: May 20th, 2012] [Originally Added On: May 20th, 2012]
- Red Bluff brings home 11th section title; McColpin throws shutout vs. Wolves [Last Updated On: May 20th, 2012] [Originally Added On: May 20th, 2012]