Skip to content

feat(glModal): fix action styling to adhere to pajamas

Paul Slaughter requested to merge ps-fix-gl-modal-actions-layout into main

What does this MR do?

This MR addresses this issue identified in this MR comment. Our current responsive button layout for modals does not adhere to our pajamas style guide.

Example

example

From the pajamas docs on modals:

Actions should always be located within an action bar at the bottom of the modal. Button order and positioning should follow our guidelines for buttons.

From the pajamas docs on buttons:

Don't: Stack buttons vertically if there is space to place them inline

So what does this MR do?

This MR introduces a new property for gl-modal called keepActionsInline. If this is true then the modal actions will not wrap. This can look really nice if space allows, so we let this be configurable from the client. If keepActionsInline is false (default behavior) then we wrap and add width: 100%.

Screenshots

Responsive keepActionsInline: false Responsive keepActionsInline: true
Screen_Shot_2021-11-05_at_3.59.51_PM Screen_Shot_2021-11-05_at_3.59.57_PM

Does this MR meet the acceptance criteria?

Conformity

Accessibility

If this MR adds or modifies a component, take a few moments to review the following:

  • All actions and functionality can be done with a keyboard.
  • Links, buttons, and controls have a visible focus state.
  • All content is presented in text or with a text equivalent. For example, alt text for SVG, or aria-label for icons that have meaning or perform actions.
  • Changes in a component’s state are announced by a screen reader. For example, changing aria-expanded="false" to aria-expanded="true" when an accordion is expanded.
  • Color combinations have sufficient contrast.
Edited by Paul Slaughter

Merge request reports

Loading