patternfly / patternfly-elements

PatternFly Elements. A set of community-created web components based on PatternFly design.
https://patternflyelements.org/
MIT License
377 stars 92 forks source link

pfe-modal design updates #811

Open coreyvickery opened 4 years ago

dcaryll commented 4 years ago

@coreyvickery looks like more description is needed here.

coreyvickery commented 4 years ago

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

Background overlay or scrim

Close button

Video modal

Player background

Background overlay or scrim

Close button


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

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 commented 4 years ago

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

castastrophe commented 3 years ago

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.

bennypowers commented 2 years ago

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

coreyvickery commented 2 years ago

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

markcaron commented 2 years ago

We should tackle these issues in RHDS