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

Dialogs are blurry in Chrome due to transform: translate #172

Open
sliptype opened this issue Jan 29, 2018 · 2 comments
Open

Dialogs are blurry in Chrome due to transform: translate #172

sliptype opened this issue Jan 29, 2018 · 2 comments

Comments

@sliptype
Copy link

Using transform: translate(-50%,-50%); with odd pixel value width & height causes rounding errors and blurriness in chrome. This is the content of a dialog before rounding the height and width to even values:

Before

And after:

After

@kendrick
Copy link
Contributor

Yep, this is a common issue with antialiasing when positioning via transform. The typical fix is to add a translateZ(0), which we're doing via translate3d. The most annoying thing about this is that since it's a rounding error it's 100% dependent on viewport width.

Since dialogs are already so JS-heavy, we might be able to get around this by positioning with JS, or by rounding the size of the dialog to the closest pixel with JS: https://stackoverflow.com/a/32329785

Would love thoughts and/or a PR on this. 😅

@kendrick
Copy link
Contributor

(After a little tooling around, I think getting rid of positioning via transform and instead adding negative margin via JS is probably the way to go for now.)

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

2 participants