-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global Styles: Add conditional Placeholder for Custom CSS when it is for a block #49627
Global Styles: Add conditional Placeholder for Custom CSS when it is for a block #49627
Conversation
@@ -112,6 +112,8 @@ function CustomCSSControl( { blockName } ) { | |||
onBlur={ handleOnBlur } | |||
className="edit-site-global-styles__custom-css-input" | |||
spellCheck={ false } | |||
/// If we are customizing at the Block level we can include placeholder text with suggested syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor tweak - extra / here and missing .
/// If we are customizing at the Block level we can include placeholder text with suggested syntax | |
// If we are customizing at the Block level we can include placeholder text with suggested syntax. |
This tested well for me and I think it is a useful addition. @carolinan do you have any thoughts on this? |
I am still concerned that a user will read the placeholder and become worried because they do not know where this code is from or if they should try to remove it and how. But it is clear from the issues opened after the feature was introduced that what we are doing right now in core and GB trunk is not working either, so let's try this. What about printing the selector surrounding the input field? |
@carolinan Having the placeholder note/text within the CSS code is a nice touch. I'll see about adding that in the PR.
I'm not sure about this one - I wonder if it has the potential to be more confusing, unless the overall display is really clear that's what the additional text outside of the textarea. |
Closed this - as the structure of Global Styles/CSS has changed in the plugin. |
What?
This PR adds placeholder text to the Custom CSS textarea conditionally when the user is adding CSS at the block level (where no selector is required).
Why?
Addresses part of #49531 -placeholder to help guide the user to the correct CSS syntax when in this context.
How?
Adding a Placeholder to the CSS textarea to prompt the correct format/syntax
Testing Instructions
Screenshots or screencast