Skip to content

Commit

Permalink
Simplify comments, use a classname that more obviously flags that the…
Browse files Browse the repository at this point in the history
… classname will not be used in output
  • Loading branch information
andrewserong committed Apr 2, 2024
1 parent caea2ed commit a2a6465
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ export default function AdvancedPanel( {
css: newValue,
} );
if ( cssError ) {
// Pass a wrapping selector to transformStyles to ensure that the CSS
// tested resembles actual CSS rules. This is necessary because the additional CSS
// field supports CSS rules that are not wrapped in a selector.
// Note: The wrapping selector here is not used in the actual output of any styles.
// Check if the new value is valid CSS, and pass a wrapping selector
// to ensure that `transformStyles` validates the CSS. Note that the
// wrapping selector here is not used in the actual output of any styles.
const [ transformed ] = transformStyles(
[ { css: newValue } ],
'.editor-styles-wrapper'
'.for-validation-only'
);
if ( transformed ) {
setCSSError( null );
Expand All @@ -47,13 +46,12 @@ export default function AdvancedPanel( {
return;
}

// Pass a wrapping selector to transformStyles to ensure that the CSS
// tested resembles actual CSS rules. This is necessary because the additional CSS
// field supports CSS rules that are not wrapped in a selector.
// Note: The wrapping selector here is not used in the actual output of any styles.
// Check if the new value is valid CSS, and pass a wrapping selector
// to ensure that `transformStyles` validates the CSS. Note that the
// wrapping selector here is not used in the actual output of any styles.
const [ transformed ] = transformStyles(
[ { css: event.target.value } ],
'.editor-styles-wrapper'
'.for-validation-only'
);

setCSSError(
Expand Down

0 comments on commit a2a6465

Please sign in to comment.