Skip to content

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

Closed

Description

@cvrebert

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

Activity

  1. added
    jsJavaScript or TypeScript sources and plugins
    cssSass sources or compiled CSS
    v4v4, the frozen docs on gh-pages
    on Feb 28, 2016
  2. cvrebert commented on Mar 14, 2016

    @cvrebert
    CollaboratorAuthor
  3. XhmikosR commented on Mar 14, 2016

    @XhmikosR
    Member

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

  4. cvrebert commented on Mar 14, 2016

    @cvrebert
    CollaboratorAuthor

    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).

  5. XhmikosR commented on Mar 14, 2016

    @XhmikosR
    Member

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

  6. cvrebert commented on Mar 14, 2016

    @cvrebert
    CollaboratorAuthor

    AFAICT, old days.

  7. XhmikosR commented on Mar 14, 2016

    @XhmikosR
    Member

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

  8. added this to the v4.0.0-alpha.6 milestone on Oct 24, 2016
  9. mdo commented on Oct 24, 2016

    @mdo
    Member

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

  10. added
    has-prAn open pull request addresses it
    on Oct 25, 2016
  11. added a commit that references this issue on Oct 26, 2016
    aa11f00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cssSass sources or compiled CSShas-prAn open pull request addresses itjsJavaScript or TypeScript sources and pluginsv4v4, the frozen docs on gh-pages

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions