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

Add/relative units for font size #25825

Closed

Conversation

kirilzh
Copy link
Contributor

@kirilzh kirilzh commented Oct 5, 2020

Description

Fixes: #23323
This PR adds the option to set custom CSS font sizes to font-size-picker component by adding a switch toggle underneath Font sizes dropdown.

Currently, when the user sees a dropdown with the predefined font-sizes, an adjacent custom field which accepts only numbers and shows the font size using pixels for units of measure, and the reset button which clears the custom field and sets font size to default.

To allow for writing more complex sizing formulas in this PR adds a toggle which when activated removes the font-size dropdown and renders a large custom field which in addition accepts string values.

How has this been tested?

This is a draft still so will add tests when changes are accepted.

Screenshots

Toggle OFF.
This is the default state of the toggle.

image

Toggle ON.

image

Types of changes

New feature (non-breaking change which adds functionality).

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@kirilzh kirilzh added the Needs Design Feedback Needs general design feedback. label Oct 6, 2020
@joyously
Copy link

joyously commented Oct 6, 2020

I have a difficult time determining which is OFF and which is ON, especially since the one you say is OFF has a box that says Custom.

@kirilzh
Copy link
Contributor Author

kirilzh commented Oct 7, 2020

@joyously I updated the description. You're right that in both cases it the label is Custom but I kept it only because the text placeholder suggests that the user can write more expressive formulas. I would be happy to change it if you have something more appropriate in mind.

@joyously
Copy link

joyously commented Oct 7, 2020

Can you show how it looks now? My main concern is that a rounded box with a circle in it does not indicate ON or OFF to me. How about a checkbox, which is fairly standard and easy to understand? Or just a value for Custom in the dropdown, that then allows input of the custom value.

@kirilzh
Copy link
Contributor Author

kirilzh commented Oct 14, 2020

@joyously Here is how the sizing options currently look:

with-regular-sizing

and here's how it looks with the changes from this PR

with-advanced-sizing

I think the toggle is fairly standard way of representing the state of the component. For example the "airplane mode" toggle on mobile devices is now ubiquitous, so my assumption is that users will find it familiar and easy to use.

@joyously
Copy link

Thanks for the screenshots.
I think checkboxes are more standard than that rounded thingy. Even though you think it's ubiquitous, I don't have much exposure to it. I do have experience with trying to help an elderly man use his phone. He doesn't have a clue what to do. And some time back, I helped a friend configure his replacement phone. We couldn't figure out how to get the mail app to check for new mail since there was nothing to interact with. I asked my nephew who told me to slide down from the top, and that everyone knows that. It did work, but there was no way for the user to figure that out.

The thing you think is standard might be common, but it certainly isn't friendly. It looks to me like a strange button because of the color, but that's only when ON. I can't tell if the blue is indicating the current state or where to click to activate it. It's more cognitive load than is necessary.
I'm no a11y expert, but I thought that things appearing and disappearing was bad for a11y.

@kirilzh kirilzh requested a review from aristath October 14, 2020 14:53
@kirilzh kirilzh marked this pull request as ready for review October 14, 2020 14:59
@AlexChariyska
Copy link

I agree with @kirilzh. I believe that using the toggle button will be more consistent with the current design of the settings box, the Drop cap functionality uses the same type of toggle button as seen in the provided screenshots.

@joyously
Copy link

Yes, it's the same as others, which are also bad. But this is the one asking for design feedback so I mentioned it here.

packages/components/src/font-size-picker/index.js Outdated Show resolved Hide resolved
packages/components/src/font-size-picker/index.js Outdated Show resolved Hide resolved
packages/components/src/font-size-picker/index.js Outdated Show resolved Hide resolved
@kirilzh kirilzh force-pushed the add/relative-units-for-font-size branch from e7d59f6 to ade7684 Compare October 19, 2020 06:58
@kirilzh kirilzh requested review from aristath and ItsJonQ October 20, 2020 06:49
Base automatically changed from master to trunk March 1, 2021 15:44
@aristath
Copy link
Member

@kirilzh could you please rebase this PR? I wanted to check it out again today and see how we can move it forward, but the font-size-picker has changed a bit since the PR was first submitted so it will have to be updated first 👍

@paaljoachim
Copy link
Contributor

Hi @aristath I believe that @kirilzh is not around any longer which means someone else will need to take the reins of this PR.

@aristath
Copy link
Member

Closing this one since it no longer applies.
We still need to do it, but with the introduction of G2 components for font-size, this PR is no longer relevant and we'll need to fix this in G2 instead.

@aristath aristath closed this Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add relative units for font size option
5 participants