parcel-bundler / parcel-bundler/lightningcss

Support transforming oklab/oklch functions with variables in alpha value

Open
#592 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
7.7k
Forks
302
PR merge metrics
No merged PRs in 30d

Description

For example:

.text-red-200 {
  --tw-text-opacity: 1;
  color: oklch(92.19% 0.04 20 / var(--tw-text-opacity));
}

can be transpiled to something like this: (similar to how postcss-oklab-function does)

.text-red-200 {
  --tw-text-opacity: 1;
  color: rgba(255, 219, 218, var(--tw-text-opacity));
}

@supports (color: color(display-p3 0 0 0)) and (top: var(--f)) {
  .text-red-200 {
    color: color(display-p3 0.9775 0.86513 0.8587 / var(--tw-text-opacity));
  }
}

@supports (color: oklch(0% 0 0)) and (top: var(--f)) {
  .text-red-200 {
    color: oklch(92.19% 0.04 20 / var(--tw-text-opacity));
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the requested transformation with the linked postcss-oklab-function behavior and reproduce the CSS example in lightningcss. Done means oklab/oklch colors with a variable alpha value produce the requested fallback and conditional color() and oklch rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, rust
Domain
compilers, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.