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

Feature request: Allow declaring default values for static classes #805

Open
armchairdj opened this issue Dec 31, 2024 · 0 comments
Open

Comments

@armchairdj
Copy link

armchairdj commented Dec 31, 2024

The static values declaration allows us to set default values so that we have the choice to accept the default value or pass in an override via data-attributes.

It would be great if the same were true for the static classes declaration. For libraries, this would allow us to set default class names but then users could override those defaults with data-attributes.

I use "visually-hidden" by default for anything I want to hide, and I expose this via static classes = ["hidden"]. But I'd love to not have to pass data-controller-name-hidden-class="visually-hidden" every single time I use the controller. I'd like to be able to pass it only when the value is something other than "visually-hidden".

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

No branches or pull requests

1 participant