Skip to content

Sidebar Mobile Support #252

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Sidebar Mobile Support #252

wants to merge 1 commit into from

Conversation

lamATnginx
Copy link
Collaborator

Proposed changes

Closes https://github.com/nginxinc/docs-platform/issues/466 and https://github.com/nginxinc/docs-platform/issues/490

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md and CHANGELOG.md)

@lamATnginx lamATnginx self-assigned this May 14, 2025
@lamATnginx lamATnginx requested a review from a team as a code owner May 14, 2025 17:21
@lamATnginx lamATnginx added the enhancement New feature or request label May 14, 2025
@lamATnginx lamATnginx mentioned this pull request May 14, 2025
4 tasks
@@ -933,6 +1012,10 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
}
}

.sidebar__mobile-open {
display: block !important;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few important!'s added in this PR, that should be removable by tweaking the specificity. For example, you could remove the important here with

nav.sidebar.sidebar__mobile-open {
  display: block;
}

.sidebar__mobile-open by itself, is only (0,1,1) specificity, but by adding the element and extra class, it increases to (0,2,1) which properly overrides the display: none triggered by

@media (max-width: 88rem) {
    .main-layout {
        & .sidebar-layout {
            nav {...`

It's long, but well worth the read - https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_cascade/Specificity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants