tylergaw / colorme

Visualize CSS Color Functions?
https://colorme.io
MIT License
316 stars 14 forks source link

Display a Deprecation/"Gonna Change in the future" Notice #16

Closed shawnnaquin closed 5 years ago

shawnnaquin commented 5 years ago

this site is a little misleading... and I know it's been sometime since the last update but...

it appears as though the previously proposed--and now deprectaed--CSS4 color module functions: color-mod() AKA color() are being used on-the-fly with CSS4 vars to produce the new color.

However, you are using a javascript plugin to produce the colors in javascript based on an out-dated spec. This is important because SASS color functions cannot accept CSS4 variables, like var(--color); since SASS is compiled vs run-time.

Without further digging it appears that you are transforming CSS4 variables on-the-fly with an out-dated spec as at the top it says "Visualize The CSS Color Function." and the function follows the same pattern as the out-dated spec.

I think some sort of deprecated warning should be presented, as this type of functionality does not exist in CSS at-the-moment.

tylergaw commented 5 years ago

Hey @shawnnaquin, thanks for opening the issue. You're right, when I built the site, the previous color function spec had discussion and momentum around it, but in the time since has gone away. Have been worried about getting some type of notice on the site for a while, but just needed a push. I'll try to get something in place soon.

Question for you (and I can dig in too myself) but do you know offhand the current status of color-mod. Any latest spec or discussion etc?

shawnnaquin commented 5 years ago

( ... that's a better title! )

There doesn't seem to be much discussion at all. In general it looks like w3c is moving towards just providing hsl(a) rgb(a) LAB and LCH. The documentation in the spec describes functions to transform between color types for use in general programming languages.

My guess is w3 considers modifying colors to be outside the scope of CSS. The CSSWG is in charge and all issues go here: https://github.com/w3c/csswg-drafts/issues

Here's the most related issue I could find: https://github.com/w3c/csswg-drafts/issues/3187

I found no issue explaining why color-mod was removed... but here's the note in the spec of when it was removed: https://drafts.csswg.org/css-color-4/#modifying-colors. ( look for color-mod on page).

Here's a random twitter post on the issue: https://twitter.com/sindresorhus/status/991610996589346817?lang=en

Your site seems to come up on every related search result... so you might have some pull in starting a new issue with CSSWG.

Let me know if you need anything else!

tylergaw commented 5 years ago

Excellent @shawnnaquin, thanks for tracking all that down, that's super helpful. I'll get at least a deprecation/warning banner up soon. (just need to remember how to work on this site first, it's been a while)

svgeesus commented 5 years ago

My guess is w3 considers modifying colors to be outside the scope of CSS. The CSSWG is in charge and all issues go here: https://github.com/w3c/csswg-drafts/issues

No, not at all. We want color modifiying functions. We don't want them to be limited to sRGB (which HSL-based calculations are).

The old color-mod functions were over complex, and were using various heuristics to try and wrangle color modifications into being somewhat perceptually uniform. This is why they were removed.

shawnnaquin commented 5 years ago

woah, hey @svgeesus!

Would be able to point us to any relevant discussion / forums on the ongoing color functions work?

svgeesus commented 5 years ago

One proposal: https://gist.github.com/una/edcfa0d3600e0b89b2ebf266bf549721 Another: https://github.com/w3c/csswg-drafts/issues/3187#issuecomment-499126198

tylergaw commented 5 years ago

This is awesome. Love seeing the momentum behind it. Just saw this popped up too https://github.com/w3c/csswg-drafts/issues/3187#issuecomment-499206254

tylergaw commented 5 years ago

Got the notice added in https://github.com/tylergaw/colorme/pull/17 and deployed. There's a service worker so the previous version could be cached.

Thanks for prod on this @shawnnaquin

and thanks for the info on the proposals @svgeesus. Exciting stuff. I'm gonna keep an eye on those as they progress and hopefully get this site fixed up with the new stuff when there's new stuff.