File tree Expand file tree Collapse file tree 5 files changed +18
-5
lines changed
src/extensions/site-design Expand file tree Collapse file tree 5 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 2323 runs-on : ubuntu-latest
2424 outputs :
2525 # Should be current latest WP Next release on `wordpress.org`. eg: `https://wordpress.org/wordpress-6.5-beta2.zip`
26- wp_next : " https://wordpress.org/wordpress-6.5-RC4 .zip"
26+ wp_next : " https://wordpress.org/wordpress-6.8-RC2 .zip"
2727 steps :
2828 - run : echo "Setting WP Next Constant"
2929
3535 uses : ./.github/workflows/test-e2e-cypress.yml
3636 with :
3737 wpVersion : ${{ needs.set_constant.outputs.wp_next }}
38- installPath : " tests-wordpress-6.5-RC4 "
38+ installPath : " tests-wordpress-6.8-RC2 "
3939 theme : " https://downloads.wordpress.org/theme/go.zip"
4040 concurrency :
4141 group : chrome-wp-next
Original file line number Diff line number Diff line change @@ -45,7 +45,10 @@ export function ColorPalettePreviews() {
4545 updateColors ( ) ;
4646
4747 Object . entries ( currentColors ) . forEach ( ( [ name , color ] ) => {
48- document . getElementsByClassName ( siteDesign . editorClass ) [ 0 ] . style . setProperty ( `--go--color--${ name } ` , color ) ;
48+ const editor = document . getElementsByClassName ( siteDesign . editorClass ) [ 0 ] ;
49+ if ( editor ) {
50+ document . getElementsByClassName ( siteDesign . editorClass ) [ 0 ] . style . setProperty ( `--go--color--${ name } ` , color ) ;
51+ }
4952 } ) ;
5053 } , [ currentColors ] ) ;
5154
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ export function SiteDesignStyles() {
6363
6464 const stylesElement = document . getElementById ( 'site-design-styles' ) ;
6565
66+ if ( ! stylesElement ) {
67+ return ;
68+ }
69+
6670 fontStylesCache = ! ! fontStylesCache ? fontStylesCache : designResp . fontStyles ;
6771
6872 // Set the style element innerHTML to remove the old design style.
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ function useFontSize() {
1616 if ( ! baseFontSize ) {
1717 return ;
1818 }
19- document . getElementsByClassName ( siteDesign . editorClass ) [ 0 ] . style . setProperty ( '--go--font-size' , `${ baseFontSize } rem` ) ;
19+ const editor = document . getElementsByClassName ( siteDesign . editorClass ) [ 0 ] ;
20+ if ( editor ) {
21+ editor . style . setProperty ( '--go--font-size' , `${ baseFontSize } rem` ) ;
22+ }
2023 } , [ baseFontSize ] ) ;
2124
2225 return [ baseFontSize , designFontSize ] ;
Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ function useTypeRatio() {
1414 if ( ! typeRatio ) {
1515 return ;
1616 }
17- document . getElementsByClassName ( siteDesign . editorClass ) [ 0 ] . style . setProperty ( '--go--type-ratio' , typeRatio ) ;
17+ const editor = document . getElementsByClassName ( siteDesign . editorClass ) [ 0 ] ;
18+ if ( editor ) {
19+ editor . style . setProperty ( '--go--type-ratio' , typeRatio ) ;
20+ }
1821 } , [ typeRatio ] ) ;
1922
2023 return [ typeRatio , designTypeRatio ] ;
You can’t perform that action at this time.
0 commit comments