New CSS styles for buttons with disabled state in WP 5.5

[last modified on July 10, 2020 at 10:58 UTC]

In WordPress 5.5, the styles for both primary and secondary buttons were updated in the WordPress adminadmin (and super admin) to produce a more consistent experience when the buttons are disabled.

Previously, the disabled button styling was inconsistent in the WordPress admin between the default and alternate color schemes. Styling was also different between primary and secondary buttons.

Prior to WordPress 5.5 betaBeta A pre-release of software that is given out to a large group of users to trial under real conditions. Beta versions have gone through alpha testing in-house and are generally fairly close in look, feel and function to the final product; however, design changes often occur as part of the process. 1 was decided to simplify all disabled button states to use the same design. There is no need for disabled buttons to convey primary and secondary visual semantics since the disabled state denotes that status.

This change introduces new unified CSSCSS Cascading Style Sheets. declarations for disabled buttons:

color: #a0a5aa;
background: #f7f7f7;
border-color: #ddd;

Those above CSS declarations are used both in the WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. dashboard and the blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. editor.

New styles for disabled primary and secondary buttons:

PluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party authors and WordPress developers are encouraged to update the CSS styles they use for their buttons with disabled state for better consistency across the ecosystem. Of course, they are even more encouraged to not use custom styles and to rather user default core UIUI User interface styles instead.

Disabled state of buttons can be easily targeted in CSS, for example by using the following selectors:

button[disabled],
input[type=button][disabled],
input[type=submit][disabled] {
	color: #a0a5aa;
	background: #f7f7f7;
	border-color: #ddd;
}

For reference, see the related TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker.: #48709.

Props @whyisjake, @desrosj and @afercia for proofreading.

#5-5, #accessibility, #core-css, #dev-notes