Add error style to checkbox and radio fields when there is error with them#2207
Conversation
WalkthroughThe pull request introduces new CSS selectors in the Changes
Possibly related PRs
Suggested labels
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
css/_single_theme.css.php (1)
341-342: Consider enhancing accessibility for error states.While the visual styling is correct, consider these accessibility improvements:
- Ensure error states are announced by screen readers using ARIA attributes.
- Verify that the error state colors meet WCAG color contrast requirements.
Example implementation:
.<?php echo esc_html( $style_class ); ?> .frm_blank_field input[type=checkbox], .<?php echo esc_html( $style_class ); ?> .frm_blank_field input[type=radio], +.<?php echo esc_html( $style_class ); ?> .frm_blank_field input[type=checkbox][aria-invalid="true"], +.<?php echo esc_html( $style_class ); ?> .frm_blank_field input[type=radio][aria-invalid="true"],
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
css/_single_theme.css.php(1 hunks)
🔇 Additional comments (2)
css/_single_theme.css.php (2)
341-342: LGTM! The implementation correctly adds error styling for checkbox and radio inputs.The changes appropriately extend the existing error styling to checkbox and radio inputs, maintaining consistency with other input types in error state.
341-342: Verify the usage of error styling in the codebase.Let's ensure the changes integrate well with existing implementations.
✅ Verification successful
✓ Error styling implementation is correct and well-integrated
The implementation follows the established pattern for form error styling, is properly scoped, and shows no conflicts with existing styles.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check usage of frm_blank_field class with checkbox/radio inputs # and verify for potential style conflicts. echo "Checking for existing implementations of frm_blank_field with checkbox/radio..." rg -l "frm_blank_field.*(?:checkbox|radio)" --type php --type js echo "Checking for potential style overrides..." rg -l "\.frm_blank_field\s+input\[type=(?:checkbox|radio)\]" --type css --type phpLength of output: 465
Script:
#!/bin/bash # Get the surrounding context of the frm_blank_field styles echo "Checking the complete context of frm_blank_field styles..." rg "frm_blank_field.*(?:checkbox|radio)" css/_single_theme.css.php -B 2 -A 5Length of output: 896
truongwp
left a comment
There was a problem hiding this comment.
Thanks @AbdiTolesa. This looks good!
shervElmi
left a comment
There was a problem hiding this comment.
Thanks @AbdiTolesa, it looks great to me! 🚀
Crabcyborg
left a comment
There was a problem hiding this comment.
Thank you @AbdiTolesa @truongwp and @shervElmi for working on this!
I'll go ahead and merge this 🚀.
Fix https://github.com/Strategy11/formidable-pro/issues/5564
Before:

After:
