-
Notifications
You must be signed in to change notification settings - Fork 197
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
Style selected state of buttons in editor for the lesson actions block #3903
Conversation
3baee1d
to
acee038
Compare
139b3a8
to
ba575fa
Compare
@@ -0,0 +1,86 @@ | |||
import { useState } from '@wordpress/element'; |
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.
It was just extracted from the edit file to a separate file.
@@ -1,4 +1,4 @@ | |||
.wp-block .wp-block-sensei-button .wp-block-button__link:disabled { | |||
.block-editor-block-styles .wp-block .wp-block-sensei-button .wp-block-button__link:disabled { |
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.
It's not needed for this PR, but it just makes it more specific for the style's thumbnails, so we can use disabled buttons in the editor if we need.
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.
Looks good, works well! Holding off on approving until #3904 is merged.
One theoretical issue is that because we're only using CSS to indicate the "disabled" state, the inner blocks don't have an incoming param to tell them that they are disabled, which seems like it could be useful. But this is always something we can change down the road, if it becomes necessary.
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.
Code wise this looks good! I agree with @alexsanford about the constants, but otherwise once #3904 lands I'm happy to approve.
We won't show the disabled buttons in the frontend, so it was refactored to a simple solution, where we just add an opacity style through CSS.
95c9974
to
b948c91
Compare
I implemented this here: 54135a7 It's not a great solution because we depend on the next lesson to be the first button of the second group. If we change that sometime, we need to change the style. But this solution is the cleanest. Other solutions would be adding a wrapper block to each group or a separator block. |
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.
Looks good to me! 💥
Fixes #3821
Changes proposed in this Pull Request
Testing instructions
Screenshot / Video
Screen.Recording.2021-01-20.at.14.18.01.mov