gitlab-org--gitlab-foss/doc/development/fe_guide/dropdowns.md
2017-12-08 12:09:41 +01:00

776 B

Dropdowns

How to style a bootstrap dropdown

  1. Use the HTML structure provided by the docs

  2. Add a specific class to the top level .dropdown element

    .dropdown.my-dropdown
      %button{ type: 'button', data: { toggle: 'dropdown' }, 'aria-haspopup': true, 'aria-expanded': false }
        %span.dropdown-toggle-text
          Toggle Dropdown
        = icon('chevron-down')
    
      %ul.dropdown-menu
        %li
          %a
            item!
    

    Or use the helpers

    .dropdown.my-dropdown
      = dropdown_toggle('Toogle!', { toggle: 'dropdown' })
      = dropdown_content
        %li
          %a
            item!