-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use the interface package for the navigation screen #30013
Conversation
Implement interface Add hacky useBlockSelectionClearer implementation Toolbar tweaks
Size Change: +7.67 kB (+1%) Total Size: 1.41 MB
ℹ️ View Unchanged
|
import { __ } from '@wordpress/i18n'; | ||
import { cog } from '@wordpress/icons'; | ||
|
||
const BLOCK_INSPECTOR_SCOPE = 'core/edit-navigation'; |
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.
I think we can move these two to /utils/constants.js
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.
👍 I did that. I've also moved constants.js
out of utils and into its own folder (constants/index.js
). Slightly nicer than having to traverse up to root and then down into utils.
// Force the sidebar to the right side of the screen on larger | ||
// breakpoints. | ||
&.has-permanent-sidebar .interface-interface-skeleton__sidebar { | ||
position: fixed !important; |
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 there any way to avoid using !important?
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 like this package is using important
here:
position: relative !important; |
This might be a bit fragile if CSS loading order changes. With multiple !important
rules, last one read wins.
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.
Yeah it's not great.
I think the concept of a permanent sidebar could alternatively be implemented in the interface package. I can take a look as a follow-up.
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.
Being able to toggle the sidebar is 💯 !
toggle.mp4
// Force the sidebar to the right side of the screen on larger | ||
// breakpoints. | ||
&.has-permanent-sidebar .interface-interface-skeleton__sidebar { | ||
position: fixed !important; |
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 like this package is using important
here:
position: relative !important; |
This might be a bit fragile if CSS loading order changes. With multiple !important
rules, last one read wins.
Description
Progresses #29100
Implements the interface package in the navigation screen again. Most of this is lifted from the previous attempt at #28686.
I've gone a bit further this time though. For larger viewports there should be very little difference to
trunk
. A react effect and some styling fixes the sidebar to the side and makes it permanently open. Another styling tweak removes the header border that interface adds.On mobile the experience is much improved, the editor area spans the full width and the sidebar is now toggleable:
Mar-19-2021.17-38-55.mp4
There are still a few things to fix on mobile, but I'll push those to a later PR that enventually solves #29100.
How has this been tested?
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: