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

Use a single class name for opened/expanded/shown state of widgets? #19344

Closed
cvrebert opened this issue Feb 28, 2016 · 7 comments
Closed

Use a single class name for opened/expanded/shown state of widgets? #19344

cvrebert opened this issue Feb 28, 2016 · 7 comments

Comments

@cvrebert
Copy link
Collaborator

Refs #19254 (comment)

  • I don't know of any particular good reason why we currently use multiple different classes for this. Seems to just be an accident of history.
  • Using a single name would make things more uniform in general
  • Using a single name would make reimplementing Bootstrap's JS in $JS_FRAMEWORK_OF_THE_HOUR slightly easier
@cvrebert
Copy link
Collaborator Author

@mdo @XhmikosR SGTY?

@XhmikosR
Copy link
Member

I'm not quite sure I understand the suggestion. Can you share an example of how this would be?

@cvrebert
Copy link
Collaborator Author

Currently, we toggle the .open class on .dropdown-menu to open/close a dropdown menu, we toggle the .active class on .tab-pane to show/hide a tab pane, and we toggle the .in class on .collapse to (un)collapse a collapsible widget. (And likewise for other widgets.)

The suggestion is to use one class name (e.g. .active) instead of different ones (.open, .active, .in) in all these cases. So you'd always toggle .active to (de)activate a widget, regardless of which widget it is.

Basically we'd globally find-replace .open, .active, and .in with .active (or whatever single name we end up agreeing on).

@XhmikosR
Copy link
Member

Seems, simpler indeed, but what is the caveat? Or it's like that from the old days?

@cvrebert
Copy link
Collaborator Author

AFAICT, old days.

@XhmikosR
Copy link
Member

Then, I don't see any reason not to do this. It's clearly simpler.

@mdo
Copy link
Member

mdo commented Oct 24, 2016

I'm down for this. I'm thinking .active could work well for everything?

@mdo mdo added the has-pr label Oct 25, 2016
twbs-savage pushed a commit to twbs-savage/bootstrap that referenced this issue Oct 26, 2016
Fix twbs#19344 - Use a single class name for opened/expanded/shown state of widgets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants