postcss / postcss-color-function

PostCSS plugin to transform W3C CSS color function to more compatible CSS
MIT License
323 stars 31 forks source link

Add back color() support #54

Closed resource11 closed 5 years ago

resource11 commented 5 years ago

Hey @jonathantneal,

Thanks for all the work you do on this plugin! I've been following the thread about color-mod() vs color() in this repo and in your postcss-color-mod-function repo.

The CSS Working group has confirmed that color-mod() is deprecated and color() is the spec that is in the latest working draft as of January 2019.

Is it possible this plugin will be revived?

jonathantneal commented 5 years ago

Hi @resource11. That’s a fair question, and thanks for reviewing that other thread.

I believe the CSSWG was only answering the first half of your question, which was whether color-mod() was officially deprecated. color-mod() is officially deprecated.

Unfortunately, their response left some ambiguity in regards to the second half of your question, which was whether color-mod() was specifically deprecated in favor of color(). color-mod() is not deprecated specifically in favor of color()

color() and color-mod() are unrelated functions that accomplish very different things. color() is for specifying color profiles, whereas color-mod() was for modifying colors.

For what it’s worth, color() (for specifying color profiles) has shipped in Safari since 2017.


If you’re curious as to why this plugin still exists and hasn’t been updated, it is because:

  1. In the spec, color-mod() was once named color() and this plugin as written before that name was changed. No one at that time knew how unstable the name was.
  2. This plugin did not change when the spec changed because the change was confusing to understand. This is understandable if you followed the other thread.
  3. The maintainer of the library that powered this plugin did not want to drop the old name and break backward compatibility. This is understandable because they viewed this plugin as a piece of software and not just a reflection of the spec.

This is one of the reasons why I created cssdb; to report early spec stability and to track spec changes. I then push breaking changes following semver.

resource11 commented 5 years ago

Thanks for the clarification, @jonathantneal, it's helpful.

Re: points 1-3, yes, I read through entire thread (and all the sub-threads that followed), and bookmarked that glorious cssdb a while back. Did I mention that cssdb is glorious?

However!

This is great info for anyone else who wants the background of why this library's still here without digging through the threads of two libraries or the most recent version of the draft spec.

It's also still good to know the additional history behind point 3 (the css-color-function dependency). For anyone curious, here's that thread behind the keeping color().

Personally, I'm still using this older library while the spec on color-mod() is further developed by the CSSWG. It still works pretty great in our config.

jonathantneal commented 5 years ago

Closing as color() will not be re-added for modifying colors. I also hope this closed issue helps other. Thanks for following up, @resource11.