Make WordPress Core

Opened 7 weeks ago

Closed 5 weeks ago

#63381 closed defect (bug) (fixed)

Simplify gradient color specifications from rgba to rgb in theme.json

Reported by: georgestephanis's profile georgestephanis Owned by: georgestephanis's profile georgestephanis
Milestone: 6.9 Priority: normal
Severity: minor Version: trunk
Component: Editor Keywords: has-patch has-unit-tests commit
Focuses: coding-standards Cc:

Description

Pushed through to Gutenberg via https://github.com/WordPress/gutenberg/pull/70008 however that file does not sync to core, so doing a standalone ticket here.

linked gh pr incoming in lieu of a .patch file

Change History (3)

This ticket was mentioned in PR #8766 on WordPress/wordpress-develop by @georgestephanis.


7 weeks ago
#1

  • Keywords has-unit-tests added

Currently, the theme.json that ships in core at wp-includes/theme.json default gradients are inconsistent in color specification -- a number of places it uses rgba(#,#,#,1) even though that is equivalent to just rgb(#,#,#) -- there is no rhyme or reason I can see as to why rgba is used here, so this is to trim a couple bytes by serving them up as rgb instead of rgba.

As there is no transparency here, it may be slightly more efficient to use hex? But I'm fine leaving it as RGB for less code churn in core unless anyone feels strongly here.

More discussion in the Gutenberg repository, but it was merged there and recommended to be made as a core ticket by @t-hamano

@link https://github.com/WordPress/gutenberg/pull/70008

#2 @wildworks
7 weeks ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.9

#3 @SergeyBiryukov
5 weeks ago

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

In 60234:

Coding Standards: Simplify gradient color specifications in theme.json.

rgba(#,#,#,1) is equivalent to rgb(#,#,#) and can be replaced with the latter for more consistency.

Original PR from Gutenberg repository:

Follow-up to [50959], [55405].

Props georgestephanis, wildworks, juanfra.
Fixes #63381.

Note: See TracTickets for help on using tickets.