UX: Styling backwards compatibility for old user page navigation (#19161)

While updating all user pages to use the new horizontal, scrollable user
page navigation, we've inadvertently broken the interface for plugins which rely on the
`user-main-nav` plugin outlet to extend the user profile page. Such
plugins usually add a new user profile page with the following
template structure which is copied from Discourse core before the user
page navigation redesign:

```
{{#d-section pageClass="..." class="user-secondary-navigation" scrollTop=false}}
  {{#mobile-nav class="..." desktopClass="action-list nav-stacked"}}
    ...
  {{/mobile-nav}}
{{/d-section}}

<section class="user-content">
  {{outlet}}
</section>
```

This commit seeks to add backwards compatibility in terms of the styling
of the interface such that even if the old template structure is used,
it would not look completely broken.
This commit is contained in:
Alan Guo Xiang Tan 2022-11-23 11:53:08 +08:00 committed by GitHub
parent 27b7f28739
commit 5552e257d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -3,7 +3,7 @@
// Grid layout
width: 100%;
display: grid;
grid-template-columns: 1fr;
grid-template-columns: 1fr 5fr;
grid-template-rows: auto 1fr;
grid-gap: 0;
@ -38,6 +38,20 @@
justify-self: start;
grid-row-start: 2;
}
// For backwards compatibility with legacy design
.user-secondary-navigation {
margin-top: 2em;
grid-column-start: 1;
grid-column-end: 2;
}
// For backwards compatibility with legacy design
.user-secondary-navigation ~ .user-content {
min-width: 100%;
grid-column-start: 2;
grid-column-end: 3;
}
}
.user-nav-dropdown-list-item {

View File

@ -12,6 +12,11 @@
}
}
// For backwards compatibility with legacy design
.user-secondary-navigation {
margin-top: 1.5em;
}
.user-navigation-secondary {
font-size: var(--font-up-1);