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

Disabling custom font sizes does not remove 'custom' option from Paragraph block font size dropdown #17941

Closed
badlydrawnben opened this issue Oct 14, 2019 · 7 comments
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress Storybook Storybook and its stories for components [Type] Bug An existing feature does not function as intended

Comments

@badlydrawnben
Copy link

The dropdown of theme-defined font sizes also has a 'Custom' option, even though I have defined the theme font sizes and removed support for custom font sizes.

To reproduce:
Blank installation of WP 5.2.3 and TwentyNineteen theme.
Install and enable Gutenberg plugin (v6.6.0)
Add this snippet to functions.php
add_theme_support('disable-custom-font-sizes');

Expected behaviour:
The custom text size input field should not be shown - works as expected
The dropdown of text sizes (eg small, medium, large etc) should not also include 'Custom' as an option because that functionality has been removed by that snippet - Does not work as expected.

image

Note - this problem does not exist if the Gutenberg plugin is deactivated.

@badlydrawnben badlydrawnben changed the title Disabling custom font sizes does not remove 'custom' option from font size dropdown Disabling custom font sizes does not remove 'custom' option from Paragraph block font size dropdown Oct 16, 2019
@Waqas-Ali-Azhar
Copy link

Waqas-Ali-Azhar commented Oct 21, 2019

Hi @badlydrawnben , i reproduced the issue and tried adding a pull request here to resolve the issue.
#18049

@gziolo
Copy link
Member

gziolo commented Oct 31, 2019

Copying over from #18212 which turned out to be a duplicate:

Describe the bug
Originally reported in #18149:

The example which has the custom sizes disabled works only partially, since, in the dropdown, there is still
an option labeled Custom:
Screen Shot 2019-10-31 at 10 40 33

To reproduce
Steps to reproduce the behavior:

  1. Run Storybook: npm run design-system:dev or open https://wordpress.github.io/gutenberg/design-system/components/.
  2. Go to the FontSizePicker section.
  3. Pick the one named Without Custom Sizes
  4. Check the select box.

Expected behavior
There is no Custom option when disableCustomFontSizes flag is passed to FontSizePicker component.

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version 77

@gziolo gziolo added [Package] Components /packages/components Storybook Storybook and its stories for components Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress labels Oct 31, 2019
@mtias
Copy link
Member

mtias commented Jul 13, 2021

@gziolo is this still the case?

@gziolo
Copy link
Member

gziolo commented Jul 19, 2021

We should have a different custom font size picker now, so it might be no longer a case. @sarayourfriend or @ciampo can you confirm?

At least in Storybook, it works as expected:

Screen Shot 2021-07-19 at 13 51 54

@mtias mtias closed this as completed Jul 19, 2021
@ciampo
Copy link
Contributor

ciampo commented Jul 20, 2021

We should have a different custom font size picker now, so it might be no longer a case. @sarayourfriend or @ciampo can you confirm?

I'm personally not familiar with this component, but looking at the folder history, there's been quite a few changes to its source code (refactors and bug fixes)

At least in Storybook, it works as expected

I can confirm that the "Without Custom Sizes" storybook story seems to work as expected (and therefore doesn't reproduce the original bug in this issue)

@smileBeda
Copy link

This is frustrating.

It is by far the worst result off what bad naming conventions can do.

add_theme_support( 'disable-custom-colors' );
...?!

==> remove_theme_support( 'custom-line-height' ); everyone gets it!
==> add_theme_support( 'disable-custom-colors' ); ... 🫨 couldn't it just be named according to other such supports, namely, that would be remove_theme_support( 'custom-colors' );. Duh. Simple, and doc would also still make sense, which now it clearly doesn't anymore (see https://developer.wordpress.org/reference/functions/remove_theme_support/, which basically encourages to use remove_theme_support on those self-negating features.

So, in other words, you have to do linguistical and logical mind juggling to understand what what does.

Can't something be done about this?

🤷

@ciampo
Copy link
Contributor

ciampo commented Jul 3, 2024

Hey @smileBeda ,

I'm not sure that the point you're raising is relevant to this specific issue. I would encourage you to open a separate issue or discussion, while also adopting a spirit of collaboration and assuming positive intent from the open source community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress Storybook Storybook and its stories for components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants