CYS: apply white color to the heading elements in the core/cover block (#48447)

* CYS: apply color to the heading elements in the core/cover block

* Add changefile(s) from automation for the following project(s): woocommerce

* fix color

* add E2E test

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Luigi Teschio 2024-06-13 10:48:06 +02:00 committed by GitHub
parent 1f4a86c7f1
commit e044ea9120
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 38 additions and 0 deletions

View File

@ -1593,6 +1593,15 @@ export const COLOR_PALETTES = [
text: 'var(--wp--preset--color--foreground)',
},
},
'core/cover': {
elements: {
heading: {
color: {
text: '#ffffff',
},
},
},
},
'core/site-title': {
elements: {
link: {

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
CYS: apply white color to the heading elements in the core/cover block </details> <details> <summary>Changelog Entry Comment</summary>

View File

@ -350,6 +350,25 @@ test.describe( 'Assembler -> Color Pickers', () => {
} )
);
const headersInCoverBlock = await editor
.locator(
`.wp-block-cover__inner-container h1,
.wp-block-cover__inner-container h2,
.wp-block-cover__inner-container h3,
.wp-block-cover__inner-container h4,
.wp-block-cover__inner-container h5,
.wp-block-cover__inner-container h6`
)
.evaluateAll( ( elements ) =>
elements.map( ( element ) => {
const style = window.getComputedStyle( element );
return {
background: style.backgroundColor,
color: style.color,
};
} )
);
for ( const element of buttons ) {
await expect( element.background ).toEqual(
colors.button.background
@ -367,6 +386,12 @@ test.describe( 'Assembler -> Color Pickers', () => {
true
);
}
// Check that the headers in the cover block are white text.
// See: https://github.com/woocommerce/woocommerce/pull/48447
for ( const element of headersInCoverBlock ) {
expect( element.color ).toEqual( 'rgb(255, 255, 255)' );
}
} );
}