这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(examples): css specificity in Tailwind example #10657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 11, 2025
Merged

Conversation

anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented Jul 11, 2025

Description

As described in #10642, CSS specificity wasn't being handled correctly in the example. This PR fixes it by ensuring the compiled stylesheet from the package:

  • Uses a prefix. This fixes all specificity issues by itself, but also...
  • Is used directly in the app instead of trying to go through the app's Tailwind compilation process
  • Is applied before the app's stylesheet, so that things can be properly overridden by the app (since they're later in the CSS evaluation)

Testing Instructions

Try it out!

Add 3 new tests to increase coverage from 87.50% to 90.57%:

- test_close_with_timeout: Tests the close_with_timeout method
- test_client_error_handling: Tests error handling when client fails
- test_add_session_id: Tests the add_session_id utility function

These tests cover previously untested code paths including timeout handling,
error scenarios, and utility functions.
@anthonyshew anthonyshew requested a review from a team as a code owner July 11, 2025 13:02
@turbo-orchestrator turbo-orchestrator bot added the area: examples Improvements or additions to examples label Jul 11, 2025
@anthonyshew anthonyshew linked an issue Jul 11, 2025 that may be closed by this pull request
1 task
Copy link

vercel bot commented Jul 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 3:38pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
turbo-site ⬜️ Skipped (Inspect) Jul 11, 2025 3:38pm

@tknickman
Copy link
Member

We used to use a prefix to avoid this but it looks like that was changed?

Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

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

LGTM except for Rust changes

@@ -380,4 +381,115 @@ mod tests {
let payloads = &found[0];
assert_eq!(payloads.len(), 2);
}

Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is necessary?

@anthonyshew
Copy link
Contributor Author

@tknickman Sigh, they added docs for how to use prefixes now. I've looked at least 10 times over the course of the past N months for this and figured it just wasn't a thing. 🤦 Circling back...

@anthonyshew
Copy link
Contributor Author

@tknickman There we are. Thank goodness they brought it back (or made it discoverable).

@anthonyshew anthonyshew merged commit 5464b0c into main Jul 11, 2025
35 checks passed
@anthonyshew anthonyshew deleted the shew/ce3cc branch July 11, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Improvements or additions to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tailwind Specificity Conflicts
3 participants