Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multilayers in dark mode (elevations) #1765

Open
8 tasks
yceballost opened this issue May 8, 2024 · 2 comments
Open
8 tasks

Multilayers in dark mode (elevations) #1765

yceballost opened this issue May 8, 2024 · 2 comments

Comments

@yceballost
Copy link
Collaborator

Description

OverMedia context (#1764) can resolve elevation problems in dark mode.

BackgroundContainer should set a color with opacity to make possible different elevation when you include a boxed component inside other boxed component.

This opacity in backgroundContainer will be a problem when you use a boxed over image or floating elements (sidebar, fixed elements in the screen, etc). To fix this problem we need to create new tokens that will be used with OverMedia context

Tasks

  • Update specs
  • Design documentation
  • Add to mobile library
  • Add to desktop library
  • Add to UI Kit
  • Android ticket
  • iOS ticket
  • Web ticket
@aweell
Copy link
Collaborator

aweell commented May 23, 2024

There are three categories here:

  1. Elements that are directly positioned over a media element: They should have a solid color
  2. Elements that are positioned over another container or background: The should have a transparent color
  3. Elements that are fixed, relative or absolute positioned: They should have a solid color

The solution proposed:

  • Change the following tokens in dark to a white with alpha:

    • backgroundContainer,
    • backgroundContainerBrand,
    • backgroundContainerBrandOverInverse,
    • backgroundContainerAlternative
    • backgroundContainerError
  • Create new tokens with -solid suffix that apply to elements that match 1 and 3 scenarios

Elements that have to use backgroundContainerSolid always:

  • FixedFooter when is over content
  • Tooltip / Popover
  • Select options container
  • Menu options container
  • Carousel Arrows
  • Sheet (Now is using background which is incorrect according to spec)

Elements that should have transparent background in dark:

  • Cards
  • Boxed
  • BoxedRow
  • EmptyStateCard
  • Callout
  • Accordion
  • Chip
  • Counter
  • IconButton
  • Texfields
  • PinField
  • Select

@aweell
Copy link
Collaborator

aweell commented May 24, 2024

There were two initial approaches for this task:

  1. Generate layers with alpha
  2. Determine when specific elements are contained within others to change their background

I propose a third approach: using borders, similar to light mode, on elements that can potentially be placed inside a boxed element.

The reason for this proposal is that, for example, with interactive elements like text fields, even using an alpha for the background, we cannot ensure a 3:1 contrast ratio with the card background. Adding a border would make this simpler.

@yceballost yceballost modified the milestones: 13.4.0, 14.0.0 Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants