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

Fixed pointer fill not being aligned in the center #175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Specy
Copy link

@Specy Specy commented Feb 13, 2022

Previously the fill thumb was not perfectly aligned to the center, i switched to flexbox to align it correctly. I've applied this fix to my website and thought to share here too so that it can be fixed for everyone.

Previous:
image

After:
image

royeden added a commit to royeden/react-colorful that referenced this pull request Jun 25, 2022
@omgovich
Copy link
Owner

Hi @Specy! Thanks for the PR. How to catch the alignment bug? I saw that just once when used the browser zoom.

@Specy
Copy link
Author

Specy commented Jul 29, 2022

Hi @Specy! Thanks for the PR. How to catch the alignment bug? I saw that just once when used the browser zoom.

I see it everytime i enter the preview website, i'm using chrome 103 but had this issue for long. On firefox i can't reproduce. The fix i made works for all major browsers (not sure about IE but should work too)

@omgovich
Copy link
Owner

That's kinda weird. Are you sure you don't have zoom in your browser? I'm just trying to figure out the reason.

@Specy
Copy link
Author

Specy commented Jul 29, 2022

No i don't have any zoom on my browser, I think the issue is with the border, i've had issues in the past where borders caused the size calculations to be a bit messed up. An alternative to my fix which doesn't use flexbox is to use outline instead of border, because that doesn't change the sizing of the element, at that point the html can be simplified a bit too, and reduce the size of the package a little bit. Up to you which one you prefer, i can make the changes

@omgovich
Copy link
Owner

As far as I remember outline didn't work well with border-radius until recently.

@Specy
Copy link
Author

Specy commented Jul 29, 2022

Then i guess using flexbox would be the best approach

Comment on lines 26 to 27
width: 90%;
height: 90%;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сan we keep 100% here so the design will remain the same? The component is used on dozens of thousands of projects. I wouldn't change their look.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced flexbox with a simple border to the element instead, i noticed that the parent element could probably be removed but that might break compatibility with people who modified the styling.

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

Successfully merging this pull request may close these issues.

None yet

2 participants