Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When _color_rewrite_stylesheet()
compares color values, it normalizes the case but doesn't normalize equal versions of shorthand and longhand hex values.
Tests were breaking in #2866801: Update stylelint rules color-hex-length to be consistent with Drupal's CSS standards with shorthand CSS hex values.
Proposal
Convert to longhand to normalize and compare because it's easier.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2940088-6.patch | 3.38 KB | joelpittet |
#6 | interdiff.txt | 4.02 KB | joelpittet |
#2 | 2940088-2.patch | 1.59 KB | joelpittet |
Comments
Comment #2
joelpittetHere's a patch that fixed the broken tests in #2866801: Update stylelint rules color-hex-length to be consistent with Drupal's CSS standards.
Comment #3
joelpittetComment #4
gappleComment #5
cilefen CreditAttribution: cilefen as a volunteer commentedThank you both.
Rather than add more procedural code, maybe we should put this in Drupal\Component\Utility\Color—is there a reason not to?. Also, how about a unit test?
Comment #6
joelpittet@cilefen thanks, that's a good suggestion. Not sure if my naming skill is the best but it's pretty good I hope.
Here's a unit test and new method.
Comment #7
gapple👍
Comment #10
catchCommitted/pushed to 8.6.x and cherry-picked to 8.5.x, thanks!