+ { __(
+ 'You can add custom CSS to further customize the appearance and layout of your site.'
+ ) }
+
+
+ { __( 'Learn more about CSS' ) }
+
+ >
+ }
+ />
-
- { __( 'Learn more about CSS' ) }
-
{
- const {
- __experimentalGetCurrentThemeGlobalStylesVariations,
- __experimentalGetCurrentGlobalStylesId,
- getEntityRecord,
- } = select( coreStore );
-
- const globalStylesId = __experimentalGetCurrentGlobalStylesId();
- const globalStyles = globalStylesId
- ? getEntityRecord( 'root', 'globalStyles', globalStylesId )
- : undefined;
-
- return {
- hasVariations:
- !! __experimentalGetCurrentThemeGlobalStylesVariations()
- ?.length,
- canEditCSS: !! ( globalStyles as GlobalStylesConfig )?._links?.[
- 'wp:action-edit-css'
- ],
- };
+ const hasVariations = useSelect( ( select ) => {
+ const { __experimentalGetCurrentThemeGlobalStylesVariations } =
+ select( coreStore );
+ return !! __experimentalGetCurrentThemeGlobalStylesVariations()?.length;
}, [] );
return (
@@ -107,38 +90,6 @@ function ScreenRoot() {
-
- { canEditCSS && (
- <>
-
-
-
- { __(
- 'Add your own CSS to customize the appearance and layout of your site.'
- ) }
-
-
-
-
-
- { __( 'Additional CSS' ) }
-
-
-
-
-
-
- >
- ) }
);
}