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

Destyle dialog ? #24

Open
KaKi87 opened this issue Apr 16, 2024 · 0 comments
Open

Destyle dialog ? #24

KaKi87 opened this issue Apr 16, 2024 · 0 comments

Comments

@KaKi87
Copy link

KaKi87 commented Apr 16, 2024

Hi,

In this video, Theo Browne mentions the user agent stylesheet for dialog:modal, and more specifically the max-width and max-height properties :

Blink user agent stylesheet Gecko user agent stylesheet

Which are mentioned in spec here :

Spec

In his case, it prevented the following from working :

dialog {
  width: 100vw;
  height: 100vh;
}

Result screenshot : centered dialog not filling screen size

And therefore had to add the following :

dialog:modal {
  max-width: 100vw;
  max-height: 100vh;
}

Result screenshot : dialog filling screen size

I think it would be a great default for destyle to fix this, I suppose the following would be more appropriate (although for the same result) :

dialog:modal {
  max-width: inherit;
  max-height: inherit;
}

And maybe you'll want to destyle it all the way ? Here's now it currently looks with destyle (Demo on JSFiddle, using the MDN example, bold on number is normal because using <strong>, screenshot from Chromium-based browser but Firefox looking the same) :

Modal dialog with destyle

Thanks

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

No branches or pull requests

1 participant