Skip to content

Conversation

@SwetaTanwar
Copy link

@SwetaTanwar SwetaTanwar commented Aug 29, 2025

Prerequisites checklist

What is the purpose of this pull request?

Fix eslint/css#235

What changes did you make? (Give an overview)

Allow relative color syntax for rgb() and rgba(), following syntaxes are now valid:

/* Relative values */
rgb(from green r g b / 0.5)
rgb(from #123456 calc(r + 40) calc(g + 40) b)
rgb(from hwb(120deg 10% 20%) r g calc(b + 200))
rgb(from hsl(0 100% 50%) r g b)
rgb(from hsl(0 100% 50% / 0.8) r g b / alpha)
rgb(from hsl(0 100% 50% / 0.8) r g b / 0.5)
rgb(from hsl(0 100% 50%) calc(r/2) calc(g + 25) calc(b + 175) / calc(alpha - 0.1))

Related Issues

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Aug 29, 2025
@eslintbot eslintbot added this to Triage Aug 29, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Aug 29, 2025
@SwetaTanwar SwetaTanwar marked this pull request as ready for review August 30, 2025 12:59
@snitin315 snitin315 moved this from Needs Triage to Implementing in Triage Aug 31, 2025
@coveralls
Copy link

coveralls commented Aug 31, 2025

Pull Request Test Coverage Report for Build 17358731850

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.618%

Totals Coverage Status
Change from base Build 17211507538: 0.0%
Covered Lines: 11829
Relevant Lines: 11961

💛 - Coveralls

@snitin315
Copy link

@SwetaTanwar Can you check the lint failure?

@SwetaTanwar
Copy link
Author

@snitin315 Done.

Copy link

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks ⭐

@SwetaTanwar Let's also add a test case in the CSS repo once this patch is released.

@snitin315 snitin315 merged commit a08c7ab into eslint:main Aug 31, 2025
17 checks passed
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Aug 31, 2025
@jaymarvelz
Copy link

jaymarvelz commented Aug 31, 2025

@snitin315 I don’t understand how this was merged. Not only does it not address eslint/css#235 at all, but it also seems to be the wrong fix. Please revert and reopen the issue.

@SwetaTanwar
Copy link
Author

I don’t understand how this was merged. Not only does it not address eslint/css#235 at all,

@jaymarvelz I think you are mistaken, this PR directly address the mentioned issue, I have added test cases here to verify that the PR fixes the issue eslint/css#247

@nzakas
Copy link
Member

nzakas commented Sep 2, 2025

@jaymarvelz this comment was unproductive. If you believe there's something missing or a case that wasn't covered, please explain, don't just ask for a revert.

@snitin315 I would have liked the opportunity to review this PR before it was merged.

@nzakas nzakas mentioned this pull request Sep 2, 2025
8 tasks
@nzakas
Copy link
Member

nzakas commented Sep 2, 2025

@SwetaTanwar thanks for looking into this. It looks like you created your own entries in patch.json, and while that's part of the correct approach, we need to make sure we're using type definitions as they appear in the CSS specifications. Otherwise, it becomes difficult to track down updates as new specifications are incorporated.

The syntax you're using for rgb() and rgba() isn't quite correct (we shouldn't be including calc(), as one example), and there are more functions that support relative color syntax, too.

With apologies, I'm going to revert this PR so we can continue to work on the details. I've opened an issue explaining what needs to be done:
#82

nzakas added a commit that referenced this pull request Sep 2, 2025
nzakas added a commit that referenced this pull request Sep 2, 2025
Revert "fix: allow relative color syntax for rgb() & rgba() (#80)"

This reverts commit a08c7ab.
@snitin315
Copy link

@SwetaTanwar @nzakas Apologies, I'll make sure to keep the PR open for a few days for further reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted bug Something isn't working contributor pool

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Rule Change: Allow relative color syntax for <color>

5 participants