Skip to content

fix: add note about exception based on source code - #10574

Open
travisrcory wants to merge 5 commits into
adobe:mainfrom
travisrcory:styling-docs/clarify-tailwind
Open

travisrcory wants to merge 5 commits into
adobe:mainfrom
travisrcory:styling-docs/clarify-tailwind

Conversation

@travisrcory

@travisrcory travisrcory commented Sep 4, 2026

Copy link
Copy Markdown

This PR attempts to add a note to the styling when using the tailwind plugin to help catch the gotchas in the source code for how some of the data attributes map onto to tailwind selectors. Thaknks!

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices
  • I understand every change in this PR and can explain why it's there.
  • If AI-assisted, I followed our AI contribution guidance and pointed my assistant at CLAUDE.md.

📝 Test Instructions:

🧢 Your Project:

</Tabs>
```

### Exceptions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is covered in the next section no?

@travisrcory travisrcory Sep 6, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Kinda, the gotcha my team ran into was that "hovered" uses "hover" instead of "hovered" which would one might expect at first glance at the docs (unless I'm not reading them closely!).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, I see the confusion. I think it's covered by

and native CSS pseudo classes

which, native CSS doesn't have a hovered

though that

when the names conflict

I think is making it a little confusing

Instead of it being an exceptions section, we could put in a mapping of all the pseudo selectors and their data attribute equivalent in a Disclosure in the Modifier prefix section

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That sounds great, I'll make that update!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I made the update in 1374611.

Full disclosure, I used an LLM to double check the source code and ensure that I pulled in the correct states. The LLM used this file from the source code as evidence for the additional states I added. Looking at it, it seems correct. I worry it might be too much information, but I was erroring on the side of surfacing all potential states. I'm happy to update this to just use the initial states that might cause some confusion for users!

Thanks again, I'm really enjoying using react aria components and I appreciate the tooling you all have made available to the community!

@snowystinger

Copy link
Copy Markdown
Member

Right idea, but it doesn't quite look right. I think we must not have support for that syntax just yet.
Screenshot 2026-09-09 at 7 42 40 am
I think you can do something like this for now

import {StaticTable} from '../../src/StaticTable';

<StaticTable
  headers={['State', 'Tailwind class']}
  rows={[
    ['data-allows-removing', 'allows-removing:'],
    ['data-open', 'open:'],
    ['data-placement="left"', 'placement-left:']
  ]}
  codeColumns={[0, 1]}
/>

snowystinger
snowystinger previously approved these changes Sep 14, 2026

@snowystinger snowystinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd just move these back together

Comment thread packages/dev/s2-docs/pages/react-aria/styling.mdx Outdated
Comment thread packages/dev/s2-docs/pages/react-aria/styling.mdx Outdated
Co-authored-by: Rob Snow <snowystinger@gmail.com>
@travisrcory

Copy link
Copy Markdown
Author

ah crap, I removed your review @snowystinger when I committed your suggested change 🤦

Thanks again for reviewing this! :)

@snowystinger snowystinger added ready for review documentation Improvements or additions to documentation small review Easy to review PR labels Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ready for review small review Easy to review PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants