-
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
Made notices always visible #4130
Conversation
Mmm, this is not easy to get right because there's so many use-cases: For example:
Some of these styles (those concerning the WP left sidebar) are already defined for the |
The mixins apply editor left/right position to the selector passed as argument. It allows to use position fixed with correct dimensions.
…dths lower than small breakpoint. Used editor-left & editor-right mixins to correctly position notices.
This change removes duplicate code and solves a bug related with resizing to small screen expanding WordPress menu and then resizing back to big screen.
b36767e
to
7422474
Compare
Hi @youknowriad, thank you for your review. Yes, this more complex than what I expected. I refactored this and created a mixin as you suggested. The mixin uses the logic implemented for .editor-header, but I found an existing bug and I added minor changes to the logic. |
/** | ||
* Applies editor left position to the selector passed as argument | ||
*/ | ||
@mixin editor-left( $selector ) { |
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.
Is it possible to avoid the selector parameter and use &
? that way, we could embed the @include
call instead of passing the selector as a parameter. I don't know if it's possible personally but seems nicer if so.
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.
Hi @youknowriad, you mean use something like:
.components-notice-list {
@include editor-left;
}
Unfortunately, I don't think this is possible in our case. Even if we could use & all the styles included would be applied to a descendant of .components-notice-list
I really like these mixins 👍 |
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.
Nice work here
Description
This PR aims to fix the visual issue described in #4128 and #3777. It makes the notices always visible even when the post is scrolled.
Besides being fixed sticky behavior has required for things to look as expected in resolutions < 600px.
How Has This Been Tested?
Add a post with much content (requires scroll).
Save the post, resize the window to width < 600px scroll from the top until the end and verify the notice is correctly shown and the sticky behavior looks as expected.
Resize the window to points between this set of number {600, 782, 960, >960}, verify that notice always adapts and is always shown in the correct position even the look changes (elements are hidden shown)
Screenshots (jpeg or gifs if applicable):
cc: @afercia