-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Match height of font range control with the size select. #11555
Match height of font range control with the size select. #11555
Conversation
This also aligns the range up/down controls to the right side of the input.
@m-e-h, it's been a few months since you opened this PR and it didn't get reviewed :( Would you mind refreshing this branch so we could test it again the latest version of the |
I just refreshed the branch. (I think I did it correctly). Only question I have here is the padding adjustment I made. I'm guessing all components-range-control__number inputs suffer from the browser styled controls moving away from the right edge and even overlaying the number in some cases. Not familiar with the story that lead to the original padding but I'm thinking there may be an |
The height looks good on my end, but I'm not 100% sure of the padding update. This is a tough one since it looks like the OS-provided styles there can vary a bit. On a Mac at least, the arrow buttons are matched to the font size. This PR makes the arrows push just a little closer to the right edge than I'd anticipate they would: |
Oh yeah, I guess it's more to do with the OS than the browser. Though Chrome and Firefox do render differently on my Ubuntu OS. In addition to my Firefox screenshot above, here's what I see in Chrome. Most browser stylesheets appear to give inputs a I can't think of where the I'm also wondering if we really need to overwrite any |
Thinking about the padding a little more, it should probably be applied the same to both the right and left sides of the input to account for Another option may be to increase the width a tad. 55px wide should be enough to at least show the Can anyone even confirm what I'm seeing? Maybe my Linux distro or GTK theme is doing something weird. What's a "36.5" value look like on Windows? |
This seems like a relatively simple fix. It's currently 50px. Adding an extra 5px doesn't appear to break anything on my end. I'd probably round it up to 56px wide, so it's a clean multiple of our base size (8px). |
I feel like maybe there should be some more abstraction here for a generic number input, independent of the range control (also why are we using a range control class outside of the range control component…?) but this looks nice. Has always bugged me how small that input is. Maybe worth shipping and iterating later? One thing to note, not a blocker, is that in my rare spare time I'm working on some new ideas for how the font size components looks/works in general, to make it easier to implement responsive font sizing. See #11671 for more on that effort, hoping to have an update soon :) |
That's right @kjellr . Sorry I updated at the end of the day yesterday and didn't have time to comment. @chrisvanpatten nailed it:
Currently we have
Then we have our blanket styles for all
Then for
Some number inputs are fine with this base and stand In the case of the font-picker (curently), we change the height to match either the The new focal point component uses
A few reusable component classes, like Chris mentioned would solve a lot of this. It would also lend a sort of core "style classes" for block creators to use. For the Font size picker specifically, should I give it |
I'm thinking they should go on the base https://github.com/WordPress/gutenberg/blob/master/packages/components/src/range-control/style.scss#L120-L126
The focal point component could change from the |
Thanks for the background!
That seems like a good solution to me too. Thanks @m-e-h! |
I just updated this PR again to focus on fixing the immediate issue. Ultimately all the But while that's being worked out, the font-size picker still looks pretty crappy. I've also added a more sensible padding to the general |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! thanks for all the work on this, @m-e-h.
* Match height of font range control with the size select. This also aligns the range up/down controls to the right side of the input. * update font range control inline docs * update with master * bring up to date with master branch * wider range number controls to account for OS specific input spinners. * Use the same height as our other number inputs. * wider number inputs to account for OS specific spinners. * Revert "wider range number controls to account for OS specific input spinners." This reverts commit d26c659. * make number input styles more consistent across components * refresh with upstream * smaller changes
* Match height of font range control with the size select. This also aligns the range up/down controls to the right side of the input. * update font range control inline docs * update with master * bring up to date with master branch * wider range number controls to account for OS specific input spinners. * Use the same height as our other number inputs. * wider number inputs to account for OS specific spinners. * Revert "wider range number controls to account for OS specific input spinners." This reverts commit d26c659. * make number input styles more consistent across components * refresh with upstream * smaller changes
Description
Match height of font range control with the font size select rather then the small reset button.
I believe this was intended to happen here #9802 (comment) but maybe got missed?
This PR also aligns the range up/down controls to the right side of the input. Currently they're crowding in on the number. (see screenshots)
How has this been tested?
visual tests in FF and Chrome
Screenshots
In Firefox:
Before
After
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: