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

The position of the picker does not work correctly when the scale value of the body tag is changed. #271

Open
yongjung opened this issue Feb 26, 2019 · 1 comment
Labels

Comments

@yongjung
Copy link

yongjung commented Feb 26, 2019

Example) scale(0.39) - click center
centerclick

@claviska
Copy link
Owner

Interesting use case. I noticed that it happens if the color picker panel or any of its parents are scaled.

I don't think I'm interested in parsing the DOM to identify CSS properties that affect scaling to determine the offset. It could get messy with nested properties and it seems like a ton of work for an edge case. If someone has an elegant solution, I'm open to a PR.

Note that, if the color picker is scaled down even just 1%, you won't be able to select all possible colors from the panel. (The name "minicolors" is derived from not being able to make the color panel any smaller while still allowing you to select all possible values.)

Also note that you can alleviate this problem by scaling the panel up the opposite amount:

body {
  transform: scale(.5); /* half size */
}

.minicolors-panel {
  transform: scale(2); /* twice the size to account for parent scaling */
}

@claviska claviska added the Bug label Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants