patternfly-elements icon indicating copy to clipboard operation
patternfly-elements copied to clipboard

pfe-modal design updates

Open coreyvickery opened this issue 4 years ago • 7 comments

coreyvickery avatar Mar 31 '20 20:03 coreyvickery

@coreyvickery looks like more description is needed here.

dcaryll avatar Apr 15 '20 17:04 dcaryll

Modal

Types

Content modal

Use to store content like text, links, and images in a modal. Modal, content (desktop)

Video modal

Use to show a video in a modal. Video (desktop)


Interaction states and styles

Content modal

Default

The color of the Close button is #6a6e73. This state is active when the focus indicator is deactivated or moved away from the Close button. Content modal, Default

Focus

A focus indicator is added to the Close button and changes the color to #151515. This is also the default state of the Close button when this type of Modal opens. Content modal, Focus

Hover

Changes the color of the Close button to #151515 if the focus indicator is deactivated or moved. Content modal, Hover

Active/Pressed

A focus indicator is added to the Close button and the color remains the same as the Hover state. Content modal, Active-Pressed

Video modal

Default

The color of the Close button is #fff. This state is active when the focus indicator is deactivated or moved away from the Close button. Video modal, Default

Focus

A focus indicator is added to the Close button and changes the color to #f0f0f0. This is also the default state of the Close button when this kind of Modal opens. Video modal, Focus

Hover

Changes the color of the Close button to #f0f0f0 if the focus indicator is deactivated or moved. Video modal, Hover

Active/Pressed

A focus indicator is added to the Close button and the color remains the same as the Hover state. Video modal, Active-Pressed


Position on grid

For marketing purposes, Modals need to be 8 columns wide on Desktop and Tablet breakpoints, and 1 column wide on Mobile breakpoints.

8-column

1 Modal (desktop) with grid 6 Video (desktop) with grid

1-column

5 Modal (mobile, portrait) with grid 10 Video (mobile, portrait) with grid

Breakpoints

Content modal

Desktop 1 Modal (desktop) with grid

Tablet, landscape 2 Modal (tablet, landscape) with grid

Tablet, portrait 3 Modal (tablet, portrait) with grid

Mobile, landscape

At breakpoints smaller than 768px, the grid reduces to 1 column and the Content modal resizes to fill the full width of the screen. 4 Modal (mobile, landscape) with grid

Mobile, portrait

At breakpoints smaller than 768px, the grid reduces to 1 column and the Content modal resizes to fill the full width of the screen. 5 Modal (mobile, portrait) with grid

Video modal

Desktop 6 Video (desktop) with grid

Tablet, landscape 7 Video (tablet, landscape)

Tablet, portrait 8 Video (tablet, portrait) with grid

Mobile, landscape

At breakpoints smaller than 768px, the grid reduces to 1 column and the Video modal resizes to fill most of the screen vertically. 9 Video (mobile, landscape) with grid

Mobile, portrait

At breakpoints smaller than 768px, the grid reduces to 1 column and the Video modal resizes to fill the full width of the screen. 10 Video (mobile, portrait) with grid


Exceptions

In rare cases where a larger layout is needed, a Content modal can be extended to be 12 columns wide on Desktop and Tablet breakpoints only. Modal, extended (desktop)


Styles

Content modal

Container background

  • Color: #fff
  • Corners: 3px
  • Alignment: Horizontally- and vertically-centered on the page

Background overlay or scrim

  • Color: #151515
  • Opacity: 65%

Close button

Video modal

Player background

  • Color: N/A
  • Corners: N/A
  • Alignment: Horizontally- and vertically-centered on the page

Background overlay or scrim

  • Color: #151515
  • Opacity: 65%

Close button

  • Color: #fff
  • Icon: Same as Content component, use icon from PatternFly 4

Spacing

Content modal

Desktop

Spacing inside Desktop and Tablet Content modals is 32px. Modal (desktop), spacing

Mobile

Spacing inside Mobile Content modals is 24px. Modal (mobile, landscape), spacing

Video modal

Desktop

The Close button is aligned to the top right corner of the player with no extra space. Video (desktop), spacing

Mobile

The right edge of the Close button is visually aligned to the right edge of the player with an 8px spacer underneath. Video (mobile, portrait), spacing

Spacing legend https://www.patternfly.org/v4/design-guidelines/styles/spacers


Accessibility

Closing the component

  • Clicking on or tapping the Close button
  • Clicking on or tapping anywhere outside of the Modal container

Focus

The Close button should be focused when a Modal opens. Modal, content (accessibility) Modal, video (accessibility)

Keyboard interactions

Key Interaction
Space or Enter (if the Modal is closed) Triggers a Modal
Space or Enter (if the Modal is open) Triggers the focused interactive element or closes the Modal (if the Close button is still focused)
Tab (if the Modal is open) Focuses the next interactive element in the tab order after the Close button

coreyvickery avatar Apr 21 '20 18:04 coreyvickery

@starryeyez024 @kylebuch8 Added notes, please let me know if I missed anything.

coreyvickery avatar Apr 21 '20 18:04 coreyvickery

Incorporating requests from #483:

Requesting to add a few additional design hooks for the modal:

--pfe-modal--BackgroundColor
--pfe-modal--BorderColor
--pfe-modal--BorderRadius

Note that with the background color variable being added, we would need to update the close icon to use the broadcasted--text color so it will show up on any background.

castastrophe avatar Jul 19 '21 17:07 castastrophe

@coreyvickery how many of these are still relevant in 2.0 patternflyelements.org/components/modal/demo

bennypowers avatar Feb 24 '22 00:02 bennypowers

@bennypowers Not sure about 2.0, but I don't think these changes have been incorporated.

coreyvickery avatar Feb 24 '22 19:02 coreyvickery

We should tackle these issues in RHDS

markcaron avatar May 17 '22 19:05 markcaron