fix (price block): apply color scheme on text#3592
Conversation
WalkthroughAdds a CSS rule to apply theme text color to price block text when a color scheme is active, using a low-specificity :where(.stk-has-color-schemes .stk-block-price) .stk-block-text selector. No removals or other modifications. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Pull request artifacts
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/block/price/style.scss (2)
15-17: Don’t override user-set text colors (.has-text-color/inline).Equal specificity means this rule can win over
.has-text-color { color: ... }or inlinestyle="color:..."if loaded later. Gate it to elements without explicit color.-:where(.stk-has-color-schemes .stk-block-price) .stk-block-text { - color: var(--stk-text-color); -} +:where(.stk-has-color-schemes .stk-block-price) +.stk-block-text:not(.has-text-color):not([style*="color"]) { + color: var(--stk-text-color, currentColor); +}
15-17: Add a safe fallback for --stk-text-color.If the var isn’t defined, color is dropped; fallback to
currentColor.-color: var(--stk-text-color); +color: var(--stk-text-color, currentColor);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/block/price/style.scss(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: PHP 8.2 and WP 6.5.5
- GitHub Check: PHP 8.2 and WP 6.7.2
- GitHub Check: PHP 8.2 and WP 6.6.2
- GitHub Check: PHP 8.2 and WP latest
- GitHub Check: PHP 7.3 and WP 6.5.5
- GitHub Check: PHP 7.3 and WP latest
🔇 Additional comments (1)
src/block/price/style.scss (1)
15-17: Use of :where() for low specificity is good; confirm intent scope.If the intent is to theme only the auxiliary text (not the numeric price), this selector is correct. If the price number should also follow the scheme, consider applying color at
.stk-block-priceand letting it inherit.
Summary by CodeRabbit