gitlab-org--gitlab-foss/doc/development/fe_guide/components.md
Marcel Amirault cc76259e8d Fix whitespace in ci docs
Many code blocks are 4spaced, and they render in GitLab
without coloring as a result, even though they are
fenced with a language label. If in a list, other items
will render as being in a code block too, even if not
meant to. This fixes all these issues for most docs in
/development, and cleans up other whitespace issues too
2019-07-31 08:28:51 +00:00

1.6 KiB
Raw Blame History

Components

Contents

Dropdowns

See also the corresponding UX guide.

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!
    

Modals

See also the corresponding UX guide.

We have a reusable Vue component for modals: vue_shared/components/gl_modal.vue

Here is an example of how to use it:

  <gl-modal
    id="dogs-out-modal"
    :header-title-text="s__('ModalExample|Let the dogs out?')"
    footer-primary-button-variant="danger"
    :footer-primary-button-text="s__('ModalExample|Let them out')"
    @submit="letOut(theDogs)"
  >
    {{ s__('ModalExample|Youre about to let the dogs out.') }}
  </gl-modal>

example modal