Skip to content

Commit 0e2762c

Browse files
aferciaalexstine
andauthored
Make the custom CSS validation error message accessible. (#56690)
Co-authored-by: Alex Stine <[email protected]>
1 parent 4bf1d21 commit 0e2762c

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

packages/block-editor/src/components/global-styles/advanced-panel.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
*/
44
import {
55
TextareaControl,
6-
Tooltip,
6+
Notice,
77
__experimentalVStack as VStack,
88
} from '@wordpress/components';
99
import { useState } from '@wordpress/element';
1010
import { __ } from '@wordpress/i18n';
11-
import { Icon, info } from '@wordpress/icons';
1211

1312
/**
1413
* Internal dependencies
@@ -58,6 +57,11 @@ export default function AdvancedPanel( {
5857

5958
return (
6059
<VStack spacing={ 3 }>
60+
{ cssError && (
61+
<Notice status="error" onRemove={ () => setCSSError( null ) }>
62+
{ cssError }
63+
</Notice>
64+
) }
6165
<TextareaControl
6266
label={ __( 'Additional CSS' ) }
6367
__nextHasNoMarginBottom
@@ -67,16 +71,6 @@ export default function AdvancedPanel( {
6771
className="block-editor-global-styles-advanced-panel__custom-css-input"
6872
spellCheck={ false }
6973
/>
70-
{ cssError && (
71-
<Tooltip text={ cssError }>
72-
<div className="block-editor-global-styles-advanced-panel__custom-css-validation-wrapper">
73-
<Icon
74-
icon={ info }
75-
className="block-editor-global-styles-advanced-panel__custom-css-validation-icon"
76-
/>
77-
</div>
78-
</Tooltip>
79-
) }
8074
</VStack>
8175
);
8276
}

packages/block-editor/src/components/global-styles/style.scss

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,3 @@
4747
/*rtl:ignore*/
4848
direction: ltr;
4949
}
50-
51-
.block-editor-global-styles-advanced-panel__custom-css-validation-wrapper {
52-
position: absolute;
53-
bottom: $grid-unit-20;
54-
right: $grid-unit * 3;
55-
}
56-
57-
.block-editor-global-styles-advanced-panel__custom-css-validation-icon {
58-
fill: $alert-red;
59-
}

0 commit comments

Comments
 (0)