Skip to content

feat: add cursor-pointer rule for all clickable elements#181

Open
gregor-tokarev wants to merge 2 commits intostylessh:mainfrom
gregor-tokarev:main
Open

feat: add cursor-pointer rule for all clickable elements#181
gregor-tokarev wants to merge 2 commits intostylessh:mainfrom
gregor-tokarev:main

Conversation

@gregor-tokarev
Copy link
Copy Markdown
Contributor

@gregor-tokarev gregor-tokarev commented May 1, 2026

Summary

Added CSS rules cursor: pointer for all clickable elements.

Changes

  • global.css

Summary by CodeRabbit

  • Style
    • Improved cursor behavior for interactive controls: enabled elements now show a pointer cursor for clearer affordance, while disabled controls show a not-allowed cursor to indicate unavailability.
    • Disabled detection now respects common disabled states and attributes so visual feedback remains consistent across buttons, links, inputs, and role-based controls.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

Adds global CSS rules in @layer base that set cursor: pointer for a broad set of interactive elements when enabled and cursor: not-allowed when disabled, detecting disabled state via :disabled, aria-disabled="true", and data-disabled attributes. (≤50 words)

Changes

Global cursor rules

Layer / File(s) Summary
Selector set
packages/ui/src/styles/globals.css
Introduces a comprehensive selector group targeting buttons, links, inputs, and various [role=...] / [data-slot=...] interactive elements.
Enabled cursor rule
packages/ui/src/styles/globals.css
Adds cursor: pointer for those selectors when not disabled (negating :disabled, aria-disabled="true", and data-disabled).
Disabled cursor rule
packages/ui/src/styles/globals.css
Adds complementary selectors that apply cursor: not-allowed when :disabled, aria-disabled="true", or data-disabled indicate disabled state.
Placement / Layering
packages/ui/src/styles/globals.css
Rules are added inside the @layer base block to ensure global base-level cursor behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete and lacks required sections. It is missing detailed 'Changes' section, 'Test Plan' with checklist items, and 'Screenshots' section specified in the template. Expand the 'Changes' section with specific file details and line changes. Add a 'Test Plan' section with testing steps. Include 'Screenshots' section if UI changes are visible, or note N/A if not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding cursor-pointer styling rules for interactive elements in the global CSS.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

Copy link
Copy Markdown
Contributor

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ui/src/styles/globals.css`:
- Around line 184-250: The interactive-selector group (notably the plain a[href]
and input[type="..."] selectors in the block containing button:not(:disabled)...
and a[href]) currently lacks explicit
:not([disabled])/:not([aria-disabled="true"])/:not([data-disabled]) exclusions
so elements like a[href][aria-disabled="true"] or
input[type="button"][data-disabled] still match the pointer rule; update the
group by adding the same exclusion list
(:not([disabled]):not([aria-disabled="true"]):not([data-disabled]):not([data-disabled="true"]))
to a[href] and each input[type="..."] selector (and any other plain selectors
such as label[for] or summary if needed) so disabled-marked elements no longer
receive cursor: pointer while keeping the existing disabled cursor rules intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b13f094-7d21-4325-9795-1d77b11d2d80

📥 Commits

Reviewing files that changed from the base of the PR and between 94ca240 and c3630a8.

📒 Files selected for processing (1)
  • packages/ui/src/styles/globals.css

Comment thread packages/ui/src/styles/globals.css
@gregor-tokarev gregor-tokarev marked this pull request as draft May 1, 2026 17:20
@gregor-tokarev gregor-tokarev marked this pull request as ready for review May 1, 2026 17:20
@stylessh stylessh mentioned this pull request May 3, 2026
1 task
Copy link
Copy Markdown
Contributor

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ui/src/styles/globals.css`:
- Around line 217-228: The global selector list including [role="menuitem"] and
[role="option"] is outside any `@layer` and is overriding Tailwind's
cursor-default utility on Radix components; fix by either removing
cursor-default from the component classNames on DropdownMenuItem,
DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuSubTrigger, and
SelectItem so the intent is explicit, or remove [role="menuitem"] and
[role="option"] from the selector list and move this cursor rule into an
appropriate `@layer` (e.g., `@layer` base) so it doesn't trump Tailwind utilities.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f9ba31bf-591e-4062-91a7-1de87717902d

📥 Commits

Reviewing files that changed from the base of the PR and between c3630a8 and 7e69f8e.

📒 Files selected for processing (1)
  • packages/ui/src/styles/globals.css

Comment on lines +217 to +228
[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not(
[data-disabled="true"]
),
[role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]):not(
[data-disabled="true"]
),
[role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled]):not(
[data-disabled="true"]
),
[role="option"]:not([aria-disabled="true"]):not([data-disabled]):not(
[data-disabled="true"]
),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that DropdownMenuItem and SelectItem receive role="menuitem" / role="option" from Radix primitives.
rg -n "role=" --type=tsx -C 2 "dropdown-menu|select" packages/ui/src/components/ 2>/dev/null || \
rg -rn "role=" -C 2 packages/ui/src/components/

Repository: stylessh/diffkit

Length of output: 1830


🏁 Script executed:

fd -type f -name "*dropdown*" packages/ui/src/components/

Repository: stylessh/diffkit

Length of output: 231


🏁 Script executed:

fd -type f -name "*select*" packages/ui/src/components/

Repository: stylessh/diffkit

Length of output: 231


🏁 Script executed:

sed -n '180,230p' packages/ui/src/styles/globals.css

Repository: stylessh/diffkit

Length of output: 1819


🏁 Script executed:

find packages/ui/src/components -name "*dropdown*" -o -name "*select*"

Repository: stylessh/diffkit

Length of output: 143


🏁 Script executed:

cat packages/ui/src/components/dropdown-menu.tsx

Repository: stylessh/diffkit

Length of output: 8099


🏁 Script executed:

cat packages/ui/src/components/select.tsx

Repository: stylessh/diffkit

Length of output: 5741


[role="menuitem"] and [role="option"] will silently override cursor-default on DropdownMenuItem and SelectItem.

The entire cursor rule block (lines 184–248) sits outside any @layer, giving it higher cascade priority than Tailwind's @layer utilities. Radix UI automatically renders DropdownMenu.Item with role="menuitem" and Select.Item with role="option". Both components deliberately use cursor-default in their className, but that Tailwind utility will be overridden by these unlayered selectors, silently changing every enabled menu/select item from cursor: default to cursor: pointer.

Either remove cursor-default from DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuSubTrigger, and SelectItem to make the intent explicit, or remove [role="menuitem"] and [role="option"] from this selector list (and move the rule inside @layer base if relying on component-level classes alone).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ui/src/styles/globals.css` around lines 217 - 228, The global
selector list including [role="menuitem"] and [role="option"] is outside any
`@layer` and is overriding Tailwind's cursor-default utility on Radix components;
fix by either removing cursor-default from the component classNames on
DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem,
DropdownMenuSubTrigger, and SelectItem so the intent is explicit, or remove
[role="menuitem"] and [role="option"] from the selector list and move this
cursor rule into an appropriate `@layer` (e.g., `@layer` base) so it doesn't trump
Tailwind utilities.

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.

1 participant