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

No ability to set manual limits for paragraph block's “Custom Size” option slider #8369

Closed
josephdickson opened this Issue Aug 1, 2018 · 14 comments

Comments

Projects
None yet
5 participants
@josephdickson

josephdickson commented Aug 1, 2018

Hi Everyone,

Currently as of Version 3.4.0 a user can slide the Custom Size slider from 12px to 100px and there appears to be no documented way limit or change this range for theme or plugin developers.

paragrpah custom font size slider limit at 48px

It is useful to give some granular control to content creators but there is no practical reason why a paragraph should be increased to 100px on an informational page.

Desktop Example:
image

Mobile Example:
image

Ideal Solution
Gutenberg's core blocks should allow for plugin and theme customization of all their individual features.

Just as we can create custom settings for the Small, Medium, Large buttons we should be able to manually set the font-size range from 16px - 32px; and go beyond 100px or below 12px.

Ideally we should also be able to customize or disable any sub component without blacklisting the entire block. Whether it's the preset buttons, custom font size slider or setting a drop cap.

Current Alternative
I could blacklist the core paragraph block and create my own replacement.

See forum support ticket for additional details at https://wordpress.org/support/topic/how-to-limit-paragraph-custom-size-options/

@josephdickson josephdickson changed the title from No Ability to set manual limits for Paragraph Blocks “Custom Size” Option slider to No ability to set manual limits for paragraph block's “Custom Size” option slider Aug 1, 2018

@josephdickson

This comment has been minimized.

josephdickson commented Aug 2, 2018

Let me know if I can be of any assistance in clarifying this request.
Thanks,
Joe

@katerlouis

This comment has been minimized.

katerlouis commented Oct 18, 2018

What's the status here?
I'm very interested in limiting the paragraph options aswell.
Is this even planned? In my opinion restricting choices the editor can make is crucial for a cohesive design.

@chrisvanpatten

This comment has been minimized.

Contributor

chrisvanpatten commented Oct 18, 2018

This is a case where I would suggest disabling support for custom font sizes and registering your own set. I don’t think it’s likely that we would support limits on the custom option, at least not until phase 2.

@katerlouis

This comment has been minimized.

katerlouis commented Oct 18, 2018

@chrisvanpatten This sounds like I could do this already? Gutenberg still confuses me, could you point me into a direction on how to approach this?

What I'd love to do is: give the editor only ONE dropdown (or set of radio buttons or whatever) where he can choose between 4 different paragraph styles, which does nothing more than giving the resulting paragraph a different class for the frontend. No color, drop cap, sizes etc.

(I remember reading something about altering / restricting the paragraph block .. but this was back in June and is probably outdated anyways)

@josephdickson

This comment has been minimized.

josephdickson commented Oct 18, 2018

Still open.
@chrisvanpatten is there documentation for this sort of thing. The handbook at https://wordpress.org/gutenberg/handbook/extensibility/extending-blocks/ doesn't yet cover blacklisting features within a block.

@ajitbohra

This comment has been minimized.

Member

ajitbohra commented Oct 18, 2018

@katerlouis @josephdickson

Docs for disabling custom font and registering your own set is under extensibility > Theme Support https://wordpress.org/gutenberg/handbook/extensibility/theme-support/#block-font-sizes

@josephdickson

This comment has been minimized.

josephdickson commented Oct 18, 2018

@ajitbohra, My mistake, I hadn't tested for 4.0
Looks like the Range slider was removed in favor of the picker. Can anyone else confirm?
Example Screenshot of Picker

@chrisvanpatten

This comment has been minimized.

Contributor

chrisvanpatten commented Oct 18, 2018

@josephdickson Yes the picker is new for 4.0. And the input field for the number will be hideable with add_theme_support( 'disable-custom-font-sizes' ); once Gutenberg 4.1 is released.

@josephdickson

This comment has been minimized.

josephdickson commented Oct 18, 2018

@chrisvanpatten fantastic! forward my thanks to everyone involved in adjusting this feature.

I guess this is closed once 4.1 comes out :)

@josephdickson

This comment has been minimized.

josephdickson commented Oct 18, 2018

@chrisvanpatten I can confirm that it is possible to customize the font sizes as @ajitbohra mentioned previously. I'll be glad to hide it completely in 4.1.

Below are some code examples that worked as of October 18, 2018 tested in WordPress 4.8 with Gutenberg 4.0 in Desktop Sever

Screenshot
gist
Twenty Seventeen Child Theme for testing

@josephdickson

This comment has been minimized.

josephdickson commented Oct 18, 2018

Unsure how to proceed, I've decided to re-open.

Should this be marked as resolved?

@josephdickson josephdickson reopened this Oct 18, 2018

@designsimply

This comment has been minimized.

Contributor

designsimply commented Nov 5, 2018

@josephdickson have you tried the solution proposed at #8369 (comment) since 4.1.1 has been released?

@josephdickson

This comment has been minimized.

josephdickson commented Nov 6, 2018

@designsimply, not yet. I'm away from a computer traveling this week but hope to test it out this weekend and update this issue.

@josephdickson

This comment has been minimized.

josephdickson commented Dec 5, 2018

@designsimply and @chrisvanpatten and everyone else here.
I can confirm that the following removes the font slider and ability to manually set a font size.

add_theme_support( 'disable-custom-font-sizes' );

Thank you everyone for helping me work through this issue. I really appreciate it.

Sorry for the late reply, I'm closing this as solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment