Support for CSS Level 4 Color Syntax (e.g. oklch(), space-separated hsl(), etc)

オープン
#12,101 コメント 5 件 リアクション 3 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript

調査の方向性

まず、リンクされた CodePen でアニメーションの失敗を再現し、その後、アニメーションする色に対する Chart.js の色処理を追跡します。oklch()、lab()、color()、およびスペース区切りの hsl()/rgb() 構文について動作を比較し、説明されているアニメーションシナリオでこれらの形式が機能し、既存の単色処理を壊さないことを完了条件とします。

索引モデルが issue の本文から書いたものです。

説明

type: enhancement
Feature Proposal

Description:

Chart.js currently doesn't have full support for modern CSS Level 4 color formats, like:

oklch(.623 .214 259.815)
color(display-p3 0.27 0.49 0.99)
hsl(216.89 100% 59.61% / 90%) (space-separated notation)

etc.

While these formats are increasingly supported across modern browsers and work fine within Chart.js when used directly as solid colors, they fail in some scenarios - for example, in animations:

animation: {
  numbers: { duration: 0 },
  colors: {
    type: "color",
    duration: 1000,
    from: "transparent",
  }
}

You can see the issue in action here: https://codepen.io/jwvqbbzv-the-looper/pen/RNWWzaG

Feature Request:

Please consider adding support for CSS Level 4 color formats, including oklch(), lab(), color(), and the updated space-separated hsl()/rgb() notation. Native browser support is already quite strong, and support in Chart.js would greatly improve flexibility and modern color handling.

Why it's important:

These formats are increasingly standard and used in modern CSS workflows.

They allow for perceptual color spaces (oklch, lab) and better control for accessibility and color contrast.

Currently, Chart.js users must work around limitations or avoid using animations with modern colors altogether.

Thank you!

Possible Implementation

No response

主要言語
JavaScript
スター
67.8k
フォーク
12k
平均マージ
6時間 15分
マージ済み PR(30日)
3

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

chartjs/Chart.js のほかの issue

chartjs/Chart.js の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。