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

Allow Dialog to have a blurred background #3623

Open
v3gard opened this issue Sep 11, 2024 · 1 comment
Open

Allow Dialog to have a blurred background #3623

v3gard opened this issue Sep 11, 2024 · 1 comment

Comments

@v3gard
Copy link

v3gard commented Sep 11, 2024

Is your feature request related to a problem? Please describe.

Before we give our users access to our Restricted data (WR0158), we require them to acknowledge the fact. We currently do this using a Scrim with a custom container inside.

image

Describe the solution you'd like

The Dialog component already takes advantage of the <dialog> HTML element. We propose adding styling opportunities to the Dialog, or just a isBlurred property that effectively blurs the background information (before acknowledgement is given).

Describe alternatives you've considered
As seen in the above screenshot, it is also possible to create a custom solution using Scrim, e.g.

export const StyledScrim = styled(Scrim)({
    position: "fixed",
    display: "flex",
    top: 0,
    left: 0,
    backdropFilter: "blur(5px)",
    boxShadow: "0px 0px 20px 0px rgba(0,0,0,0.75)",
});

export const StyledContainer = styled.div({
    backgroundColor: tokens.colors.ui.background__default.hex,
    width: "500px !important",
    padding: "1rem",
    boxShadow: "0px 0px 24px 0px rgba(0,0,0,0.75)",
    borderRadius: "4px",
});

But we think it is better to agree on a shared component with a generic solution to this problem.

Additional context

N/A

@oddvernes
Copy link
Collaborator

This sounds like something the designers should weigh in on but for now, you can always overwrite the eds Dialog backdrop in this slightly roundabout way:
give the eds Dialog a className such as .blurred-dialog and then add

dialog:has(.blurred-dialog)::backdrop {
    backdrop-filter: blur(5px);
  }

To your global styles (either styled-components createGlobalStyle or app.css or whatever you have)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants