Skip to content

Commit 92860fa

Browse files
georgestephanisgeorgestephanisjuanfraMamaduka
authored
Simplify color specifications from rgba to rgb (#70008)
* Simplify color specifications from `rgba` to `rgb` 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. * Update test to account for changed default. Co-authored-by: georgestephanis <[email protected]> Co-authored-by: juanfra <[email protected]> Co-authored-by: Mamaduka <[email protected]>
1 parent f33f63e commit 92860fa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/theme.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"gradients": [
6666
{
6767
"name": "Vivid cyan blue to vivid purple",
68-
"gradient": "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",
68+
"gradient": "linear-gradient(135deg,rgb(6,147,227) 0%,rgb(155,81,224) 100%)",
6969
"slug": "vivid-cyan-blue-to-vivid-purple"
7070
},
7171
{
@@ -75,12 +75,12 @@
7575
},
7676
{
7777
"name": "Luminous vivid amber to luminous vivid orange",
78-
"gradient": "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",
78+
"gradient": "linear-gradient(135deg,rgb(252,185,0) 0%,rgb(255,105,0) 100%)",
7979
"slug": "luminous-vivid-amber-to-luminous-vivid-orange"
8080
},
8181
{
8282
"name": "Luminous vivid orange to vivid red",
83-
"gradient": "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",
83+
"gradient": "linear-gradient(135deg,rgb(255,105,0) 0%,rgb(207,46,46) 100%)",
8484
"slug": "luminous-vivid-orange-to-vivid-red"
8585
},
8686
{
@@ -251,12 +251,12 @@
251251
{
252252
"name": "Outlined",
253253
"slug": "outlined",
254-
"shadow": "6px 6px 0px -3px rgba(255, 255, 255, 1), 6px 6px rgba(0, 0, 0, 1)"
254+
"shadow": "6px 6px 0px -3px rgb(255, 255, 255), 6px 6px rgb(0, 0, 0)"
255255
},
256256
{
257257
"name": "Crisp",
258258
"slug": "crisp",
259-
"shadow": "6px 6px 0px rgba(0, 0, 0, 1)"
259+
"shadow": "6px 6px 0px rgb(0, 0, 0)"
260260
}
261261
]
262262
},

phpunit/class-wp-theme-json-resolver-test.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1161,12 +1161,12 @@ public function test_theme_shadow_presets_do_not_override_default_shadow_presets
11611161
),
11621162
array(
11631163
'name' => 'Outlined',
1164-
'shadow' => '6px 6px 0px -3px rgba(255, 255, 255, 1), 6px 6px rgba(0, 0, 0, 1)',
1164+
'shadow' => '6px 6px 0px -3px rgb(255, 255, 255), 6px 6px rgb(0, 0, 0)',
11651165
'slug' => 'outlined',
11661166
),
11671167
array(
11681168
'name' => 'Crisp',
1169-
'shadow' => '6px 6px 0px rgba(0, 0, 0, 1)',
1169+
'shadow' => '6px 6px 0px rgb(0, 0, 0)',
11701170
'slug' => 'crisp',
11711171
),
11721172
),

0 commit comments

Comments
 (0)