Skip to content
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

change variant name to effect, update documentation for clarity and readability #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexVipond
Copy link

"Signals" is the perfect name, this PR clarifies the mental model

@brandonmcconnell
Copy link
Owner

Thanks for the PR!

I wonder if there's something else meaningful that signal could do as a variant if we free it up with effect, even to complement the existing signal utility behavior and make that more powerful.

Because this is built upon style queries, it can do plenty more than the group variant can naturally do. I think we're just scratching the surface here, and I would love to iterate on this change while it's early.

Any ideas?

@AlexVipond
Copy link
Author

AlexVipond commented Apr 4, 2024

I agree, I'm not quite sure about use cases for signal as a variant, but I do think there's an opportunity to change the way values and modifiers are used, to tap into even more container style query features.

For example, could do signal-[<signal name>]/<signal value>, then write effect-[<signal name>]/<signal value> to say "when the signal is set to this specific value, apply a new style"

Demo here: https://play.tailwindcss.com/2QgwOtGwFK

I can't think of any great real-world use cases off the top of my head, but even just refactoring to signal-[<signal name>] feels a little more intuitive to me than using the modifier as the signal name.

@brandonmcconnell
Copy link
Owner

@AlexVipond The modifier order used to bug me. It's sort of the standard now for all Tailwind CSS utilities that accept a name, so I want to be in line with that— as close to native as possible. 🙂

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.

2 participants