Simplified positioning for the menu-panel - works for LTR and RTL layouts #3705
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@eviltrout this seems straightforward. Maybe there's something I'm missing.
position: relative
to.wrap
header.hbs
into the wrap div.menu-panel
absolutely in relation to its containing wrap divmenu-panel.js.es6
This works without any further adjustments for RTL layouts. With the way the menu-panel is currently being positioned, to position it correctly for RTL layouts will require checking if we are in a RTL layout and then adjusting the horizontal positioning values in
menu-panel.js.es6
.From my point of view, as someone who wants to be able to heavily customize the Discourse css, it would be preferable if the menu components could be moved so that where they appear in the document relates to where they are positioned on the screen. This is immediately after the header
<ul class='icons clearfix' role='navigation'></ul>
. If you can do this, all of the changes in this PR will still work. There will no longer be a need to addposition: relative
to.wrap
as it is already set on the.contents
div.As an added bonus, moving the components to their correct position in the document will allow you to set most of the vertical positioning of the menu without using javascript. (There is some difficulty in setting the slide-out menu vertical positioning and height without javascript as its position aligns with the main-outlet, not the header.)