-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Question/Suggestion; Drop 'Drop Cap' feature #6184
Comments
@JeroenSormani Medium has the feature. |
I hope that isn't the only/best argument for adding the feature 😅 So I've not seen the point in adding a feature like this for all while used by little. Its just a waste of space / setting and effort in BC in the future (when people realize it shouldn't be a setting anymore 🤔) In my mind adding such feature without real demand / need would mean leaving a door open for other useless settings that little use. |
Hi @JeroenSormani, Thanks for the suggestion! At this point, we're unlikely to remove the drop cap feature. However, we appreciate you taking the time to open this issue, and support your suggestion with research. |
@danielbachhuber I'd love to get to know the thinking behind the feature though - is it indeed solely because Medium has it? I couldn't find a path back to where the idea came from, so I can't ask directly to anyone 🤔 My own thinking is that this time (pre WP include) would be the best time possible time to deprecate a feature like this. Doing when its in WP core will likely never happen or bring bigger pains for the people involved with it at that time. |
I suppose it's far too late for this, but this does feel like something that should be enabled via |
I wouldn't say its too late, with the GB plugin active installs 'only' being at 10,000 (~ish) the impact of users using the drop cap feature is very minimal. If you wait till its in WP Core you'll have a real nightmare at hand removing it. |
Is there a way to disable the drop caps feature? I also question the inclusion of this feature, however as long as there is a way to disable it (and other text settings) then this is fine. However, I'm struggling to find information about disabling specific options. I regularly remove features like text colouring, sizing etc from the classic editor to prevent clients from getting "creative" with their type colours and sizes so I'd see these abilities as really important in my development / deployment workflow. |
It’s actually a showstopper for me. I code for three designers and none wants to move to Gutenberg unless I can kill the drop caps in the editor. |
For those like me who ended up here while looking for a way to disable the drop cap toggle (which seems a very esoteric thing to include in core without at the very least an easy way to disable it), there are potentially related discussions going on here - #15450 about a consistent way of controlling common block functionality. However, I'm not entirely sure that this will be dealt with there, given that it seems pretty specific to the paragraph block type. Because there's no clear resolution in sight, this is what I've done for now: add_action('admin_head', 'biro_gutenberg_remove_drop_cap');
function biro_gutenberg_remove_drop_cap() {
echo '<style>.blocks-font-size .components-base-control:first-of-type { margin-bottom: 0; } .blocks-font-size .components-toggle-control { display: none; }</style>';
} Being relatively new to Gutenberg I'm not entirely sure whether it will have knock-on effects in other areas. The class names are pretty generic, so it's not specifically targeting the drop cap field, just a toggle control in a blocks-font-size block. |
Thanks @adriantoll; Try as I might, I found no combination of supplied filter, unregisterBlockStyle, etc that would achieve this. As dirty as it feels, forcing a hide via your editor css is the only way I could remove Drop Caps... |
The above mentioned solution is brilliant. I'm in the process of removing all the core blocks, font sizes/colors etc and only adding in the few I want. There are a few little options which can't be removed like the dropcaps, but hiding it works for me. |
This didn't work anymore for me (WP 5.5.1, Gutenberg 9.0.0). And from a first look there are no fitting CSS selectors to do this anymore. Waiting for theme.json to be finalized to remove this. |
Looks like an experimental feature was added in WordPress 5.5 that can be used to disable the drop cap, I created a plugin that accomplishes this: https://github.com/joppuyo/remove-drop-cap |
mehh, it's almost 2021 and still not implemented, feels bad |
Thanks @joppuyo ! The following does the trick.
|
@jenswittmann ... until this gets move out of __experimentalFeatures! Rather like my initial dirty CSS hack and WP 5.5.1. If this is approved and moved out of __experimentalFeatures, is there a pre-agreed location where this setting will end up, or a transition period during which there will be a warning in the JS console that it's about to be moved and a pointer to where it will end up? I'm using a variation of the JS version in the plugin by @joppuyo and I'd rather know now instead of spend time scrabbling around to fix it on production sites when it's moved in a future version of WP. |
The css in the admin head stopped working. |
Per @joppuyo at https://siipo.la/blog/disable-drop-cap-in-wordpress-5-5 the javascript version stopped working too, and the only way I currently know is through some PHP detailed in that blog post (in the version below I use a function attached to a filter for ease of debugging): function yournamespace_remove_drop_cap ( $editor_settings ) {
$editor_settings['__experimentalFeatures']['global']['typography']['dropCap'] = false;
return $editor_settings;
}
add_filter( 'block_editor_settings', 'yournamespace_remove_drop_cap' ); |
aaand now from WP 5.7 it looks like add_filter('block_editor_settings', function ($editor_settings) {
$editor_settings['__experimentalFeatures']['defaults']['typography']['dropCap'] = false;
return $editor_settings;
}); |
In WordPress 5.8, you should be able to use the new theme.json feature to disable the drop cap. Just add a file called {
"version": 1,
"settings": {
"typography": {
"dropCap": false
}
}
} But if you want to use a plugin, you can now find my plugin on the WordPress plugin directory: |
Overview
I've searched a bit around, but couldn't find any resources on this. My main question here is;
Doing some research it doesn't seem there's any real need for this feature. The most used WP plugin has only 7,000 active installs, and a post by WP Beginner (first Google result) has 4 comments > which to me indicates there's very little interest for such option.
Only reasonable explanation I can imagine is to have a example of a checkbox/toggle option (which would be a bad reason to leave this in, IMHO)
I'd love to learn more about why this was added, or if there's no real reason / need, propose it to be removed.
The text was updated successfully, but these errors were encountered: