Skip to content

Conversation

@tarunvashishth
Copy link
Contributor

@tarunvashishth tarunvashishth commented Jan 31, 2026

Implement 44x44px minimum touch target for standalone radio and checkbox components using ::before pseudo-element approach. This improves accessibility and usability on mobile devices while maintaining the original visual layout and shape of the components.

The expanded clickable area is achieved through a CSS pseudo-element with an inset of -12px on all sides, providing an invisible but clickable expansion area. The table component inherits this improvement automatically.

  • Add --pf-v6-c-radio--m-standalone--before--Inset component variable
  • Add --pf-v6-c-check--m-standalone--before--Inset component variable
  • Add position: relative to .pf-m-standalone radio and checkbox
  • Add ::before pseudo-element with expanded inset for clickable area

Assisted-by: GitHub Copilot

Summary by CodeRabbit

  • Improvements

    • Expanded clickable/touch target for standalone checkboxes and radio buttons to a 44×44px area, improving accessibility and ease of interaction on touch devices.
    • Updated loading skeleton color stops to use standardized design tokens for more consistent appearance across themes.
  • Documentation

    • Added clarifying comments to aid future maintenance and understanding.

✏️ Tip: You can customize this high-level summary in your review settings.

Implement 44x44px minimum touch target for standalone radio and checkbox
components using ::before pseudo-element approach. This improves
accessibility and usability on mobile devices while maintaining the
original visual layout and shape of the components.

The expanded clickable area is achieved through a CSS pseudo-element with
an inset of -12px on all sides, providing an invisible but clickable
expansion area. The table component inherits this improvement
automatically.

- Add --pf-v6-c-radio--m-standalone--before--Inset component variable
- Add --pf-v6-c-check--m-standalone--before--Inset component variable
- Add position: relative to .pf-m-standalone radio and checkbox
- Add ::before pseudo-element with expanded inset for clickable area

Assisted-by: GitHub Copilot
@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

Walkthrough

Adds an expanded invisible hit area for standalone Check and Radio components via a new CSS variable and ::before overlay, and updates Skeleton gradient color stops to use loading-skeleton color tokens.

Changes

Cohort / File(s) Summary
Standalone form control touch target expansion
src/patternfly/components/Check/check.scss, src/patternfly/components/Radio/radio.scss
Introduce --#{$component}--m-standalone--before--Inset variable, set .pf-m-standalone { position: relative; }, and add a ::before pseudo-element with absolute positioning, inset based on the variable, pointer-events: auto, and empty content to create a 44×44px clickable/touch area.
Skeleton gradient color token update
src/patternfly/components/Skeleton/skeleton.scss
Replace the three linear-gradient color-stop custom properties for the ::after animation (and within reduced-motion media query) with loading-skeleton color tokens; no changes to animation or layout properties.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • mcoker
  • srambach
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: expand clickable area for standalone radio and checkbox' follows conventional commit guidelines with proper 'feat:' prefix and clearly describes the main changes across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@patternfly-build
Copy link
Collaborator

patternfly-build commented Jan 31, 2026

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@src/patternfly/components/Check/check.scss`:
- Around line 6-8: Add a blank line before the inline comment on the standalone
checkbox CSS custom property block so stylelint is satisfied; specifically, in
the check.scss block that defines --#{$check}--m-standalone--MinHeight and
--#{$check}--m-standalone--before--Inset, insert an empty line before the line
starting with "// Expanded clickable area..." leaving the variable declarations
unchanged.
- Around line 42-45: The ::before rule in the Check component (selector
&::before) has properties in the wrong order for stylelint; move the position
declaration (position: absolute) above the content declaration (content: '') and
keep the inset variable (--#{$check}--m-standalone--before--Inset) after them so
the property order is position, content, then inset within the &::before block.

In `@src/patternfly/components/Radio/radio.scss`:
- Around line 6-8: Add a blank line before the inline comment that precedes the
custom property declaration for standalone radio spacing; specifically, insert
an empty line above the comment line describing the expanded clickable area so
the comment sits on its own line before the declaration of
--#{$radio}--m-standalone--before--Inset (and near
--#{$radio}--m-standalone--MinHeight), satisfying Stylelint's rule expecting a
blank line before `//` comments.
- Around line 43-46: In the &::before rule inside radio.scss the properties are
out of order for stylelint: move the position declaration above content (i.e.,
ensure position: absolute; appears before content: '';) and keep inset after
those two; update the &::before block for the $radio standalone before inset
variable (--#{$radio}--m-standalone--before--Inset) accordingly so property
order conforms to the linter.

Comment on lines 42 to 45
&::before {
content: '';
position: absolute;
inset: var(--#{$check}--m-standalone--before--Inset);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix lint: property order in ::before.

Stylelint expects position before content (Line 43–44).

Proposed fix
     &::before {
-      content: '';
       position: absolute;
+      content: '';
       inset: var(--#{$check}--m-standalone--before--Inset);
       pointer-events: auto;
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&::before {
content: '';
position: absolute;
inset: var(--#{$check}--m-standalone--before--Inset);
&::before {
position: absolute;
content: '';
inset: var(--#{$check}--m-standalone--before--Inset);
🧰 Tools
🪛 GitHub Actions: pr-preview

[error] 44-44: order/properties-order: Expected "position" to come before "content"

🤖 Prompt for AI Agents
In `@src/patternfly/components/Check/check.scss` around lines 42 - 45, The
::before rule in the Check component (selector &::before) has properties in the
wrong order for stylelint; move the position declaration (position: absolute)
above the content declaration (content: '') and keep the inset variable
(--#{$check}--m-standalone--before--Inset) after them so the property order is
position, content, then inset within the &::before block.

Comment on lines 43 to 46
&::before {
content: '';
position: absolute;
inset: var(--#{$radio}--m-standalone--before--Inset);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix lint: property order in ::before.

Stylelint expects position before content (Line 44–45).

Proposed fix
     &::before {
-      content: '';
       position: absolute;
+      content: '';
       inset: var(--#{$radio}--m-standalone--before--Inset);
       pointer-events: auto;
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&::before {
content: '';
position: absolute;
inset: var(--#{$radio}--m-standalone--before--Inset);
&::before {
position: absolute;
content: '';
inset: var(--#{$radio}--m-standalone--before--Inset);
🧰 Tools
🪛 GitHub Actions: pr-preview

[error] 45-45: order/properties-order: Expected "position" to come before "content"

🤖 Prompt for AI Agents
In `@src/patternfly/components/Radio/radio.scss` around lines 43 - 46, In the
&::before rule inside radio.scss the properties are out of order for stylelint:
move the position declaration above content (i.e., ensure position: absolute;
appears before content: '';) and keep inset after those two; update the
&::before block for the $radio standalone before inset variable
(--#{$radio}--m-standalone--before--Inset) accordingly so property order
conforms to the linter.

@tarunvashishth
Copy link
Contributor Author

Fixes #7673

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/patternfly/components/Check/check.scss`:
- Around line 42-48: The ::before pseudo-element used to expand the clickable
area for the Check component doesn't inherit the cursor, causing the extended
region to show the default cursor; update the &::before rule in the Check
component's stylesheet (the selector using &::before inside the Check SCSS) to
include cursor: inherit so the overlay preserves pointer/not-allowed affordances
from the underlying element (keep pointer-events: auto and content: '' as-is).

In `@src/patternfly/components/Radio/radio.scss`:
- Around line 43-49: The ::before pseudo-element used to expand the clickable
area (selector &::before using inset
var(--#{$radio}--m-standalone--before--Inset)) does not preserve the cursor
state; add cursor: inherit to that ::before rule so the extended overlay uses
the same cursor (pointer or not-allowed) as the radio input, keeping affordances
consistent.

Comment on lines +42 to +48
// Expanded clickable area using pseudo-element
&::before {
position: absolute;
inset: var(--#{$check}--m-standalone--before--Inset);
pointer-events: auto;
content: '';
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Ensure the expanded hit area preserves cursor state.
The ::before overlay doesn’t inherit cursor, so the extended area can show the default cursor instead of pointer/not-allowed. Add cursor: inherit; to keep affordances consistent.

Proposed fix
     &::before {
       position: absolute;
       inset: var(--#{$check}--m-standalone--before--Inset);
       pointer-events: auto;
+      cursor: inherit;
       content: '';
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Expanded clickable area using pseudo-element
&::before {
position: absolute;
inset: var(--#{$check}--m-standalone--before--Inset);
pointer-events: auto;
content: '';
}
// Expanded clickable area using pseudo-element
&::before {
position: absolute;
inset: var(--#{$check}--m-standalone--before--Inset);
pointer-events: auto;
cursor: inherit;
content: '';
}
🤖 Prompt for AI Agents
In `@src/patternfly/components/Check/check.scss` around lines 42 - 48, The
::before pseudo-element used to expand the clickable area for the Check
component doesn't inherit the cursor, causing the extended region to show the
default cursor; update the &::before rule in the Check component's stylesheet
(the selector using &::before inside the Check SCSS) to include cursor: inherit
so the overlay preserves pointer/not-allowed affordances from the underlying
element (keep pointer-events: auto and content: '' as-is).

Comment on lines +43 to +49
// Expanded clickable area using pseudo-element
&::before {
position: absolute;
inset: var(--#{$radio}--m-standalone--before--Inset);
pointer-events: auto;
content: '';
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Ensure the expanded hit area preserves cursor state.
The ::before overlay doesn’t inherit cursor, so the extended area can show the default cursor instead of pointer/not-allowed. Add cursor: inherit; to keep affordances consistent.

Proposed fix
     &::before {
       position: absolute;
       inset: var(--#{$radio}--m-standalone--before--Inset);
       pointer-events: auto;
+      cursor: inherit;
       content: '';
     }
🤖 Prompt for AI Agents
In `@src/patternfly/components/Radio/radio.scss` around lines 43 - 49, The
::before pseudo-element used to expand the clickable area (selector &::before
using inset var(--#{$radio}--m-standalone--before--Inset)) does not preserve the
cursor state; add cursor: inherit to that ::before rule so the extended overlay
uses the same cursor (pointer or not-allowed) as the radio input, keeping
affordances consistent.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - [SelectColumn] - label intended to increase clickable area has no effect in PF6

2 participants