WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 4 months ago

#45937 closed defect (bug) (fixed)

CSS coding standards: audit the rgba() values

Reported by: afercia Owned by: afercia
Milestone: 5.2 Priority: normal
Severity: normal Version:
Component: Administration Keywords: good-first-bug has-patch
Focuses: coding-standards Cc:

Description

There are various occurrences of incorrect rgba() values across the admin stylesheets.

Incorrect examples:

rgba( 0, 0, 0, 0.3 )
rgba(0,0,0,0.1)
rgba(0,0,0,.6)

Correct example from the coding standards, see https://make.wordpress.org/core/handbook/best-practices/coding-standards/css/#values:

rgba(0, 0, 0, 0.5)

Also worth mentioning:

Use a leading zero for decimal values, including in rgba().

Given the good amount of cases to fix, it would be best to address this in a specific patch.

Attachments (3)

45937.diff (22.9 KB) - added by nielslange 5 months ago.
45937.2.diff (28.5 KB) - added by mukesh27 5 months ago.
Updated Patch.
45937.3.diff (46.2 KB) - added by afercia 4 months ago.

Download all attachments as: .zip

Change History (11)

#1 @nielslange
5 months ago

Sounds like a ticket in my league, @afercia. I’ll provide a patch within the next days! 😉

@nielslange
5 months ago

#2 @nielslange
5 months ago

  • Keywords has-patch added; needs-patch removed

@afercia I audited all rgba() occurrences in the following files:

  • src/wp-admin/css/about.css
  • src/wp-admin/css/admin-menu.css
  • src/wp-admin/css/code-editor.css
  • src/wp-admin/css/color-picker.css
  • src/wp-admin/css/common.css
  • src/wp-admin/css/customize-controls.css
  • src/wp-admin/css/customize-nav-menus.css
  • src/wp-admin/css/customize-widgets.css
  • src/wp-admin/css/edit.css
  • src/wp-admin/css/forms.css
  • src/wp-admin/css/install.css
  • src/wp-admin/css/list-tables.css
  • src/wp-admin/css/login.css
  • src/wp-admin/css/media.css
  • src/wp-admin/css/nav-menus.css
  • src/wp-admin/css/revisions.css
  • src/wp-admin/css/widgets.css

As I used the global search, I must have caught all occurrences, but let me know in case I missed one. 😀

#3 follow-up: @afercia
5 months ago

  • Milestone changed from Awaiting Review to 5.2
  • Owner set to afercia
  • Status changed from new to assigned

Thanks @nielslange ! Going to propose this for 5.2 consideration.

#4 in reply to: ↑ 3 @nielslange
5 months ago

Thanks @nielslange ! Going to propose this for 5.2 consideration.

Yeah, happy to hear that, @afercia! 🤗

Last edited 5 months ago by nielslange (previous) (diff)

@mukesh27
5 months ago

Updated Patch.

#5 @mukesh27
5 months ago

@nielslange updated patch as two css files( themes.css and dashboard.css ) are missing in above patch.

I audited all rgba() occurrences in the following files:

  • /wp-admin/css/about.css
  • /wp-admin/css/admin-menu.css
  • /wp-admin/css/code-editor.css
  • /wp-admin/css/color-picker.css
  • /wp-admin/css/common.css
  • /wp-admin/css/customize-controls.css
  • /wp-admin/css/customize-nav-menus.css
  • /wp-admin/css/customize-widgets.css
  • /wp-admin/css/dashboard.css
  • /wp-admin/css/edit.css
  • /wp-admin/css/forms.css
  • /wp-admin/css/install.css
  • /wp-admin/css/list-tables.css
  • /wp-admin/css/login.css
  • /wp-admin/css/media.css
  • /wp-admin/css/nav-menus.css
  • /wp-admin/css/revisions.css
  • /wp-admin/css/themes.css
  • /wp-admin/css/widgets.css

#6 @nielslange
5 months ago

Good catch, @mukesh27. 😉

@afercia
4 months ago

#7 @afercia
4 months ago

45937.3.diff refreshes the patch, also fixes a few more rgba() occurrences and a few spaces instead of tabs.

#8 @afercia
4 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44791:

Coding standards: Fix incorrect CSS rgba() values.

Also, fixes some indentation where spaces were used instead of tabs.

Props nielslange, mukesh27.
Fixes #45937.

Note: See TracTickets for help on using tickets.