user docs: Convert browser scrollbar overflow from .markdown to html.

Remove overflow: hidden from the body and overflow: auto from the
.markdown element. Adjust the scroll-margin-top on the heading
elements so that using the hash, the page opens at perfect
location. Add position: fixed to .sidebar so that it does not scroll
with the content.

For the mobile view, change the .sidebar right from 100vw to 100%.

Also change how the hamburger menu changes its position: use right
instead of left as that works better than translate combined with
left.
This commit is contained in:
Signior-X 2021-03-27 17:45:35 +05:30 committed by Tim Abbott
parent f63c1fa639
commit 3392be5688
4 changed files with 8 additions and 10 deletions

View File

@ -37,7 +37,7 @@
{% endblock %}
</head>
<body class="{% if noscroll %}noscroll{% endif %}">
<body>
{% block content %}
{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "zerver/portico-help.html" %}
{% set entrypoint = "help" %}
{% set noscroll = true %}
{# Zulip user and API documentation. #}
{% block title %}

View File

@ -2,7 +2,6 @@
font-weight: 400;
font-size: 1rem;
line-height: 1.5;
overflow: auto;
& h1[id],
h2[id],

View File

@ -98,7 +98,6 @@ html {
display: inline-flex;
box-shadow: 0 -20px 50px hsl(0deg 0% 0% / 4%);
overflow: auto;
color: hsl(0deg 0% 27%);
@ -125,7 +124,7 @@ html {
height: calc(100vh - 59px);
border-right: 1px solid hsl(219deg 10% 97%);
overflow: auto;
position: fixed;
background-color: hsl(153deg 32% 55%);
color: hsl(0deg 0% 100%);
@ -252,10 +251,10 @@ html {
background-color: hsl(0deg 0% 100%);
width: calc(100vw - 300px);
height: calc(100vh - 59px);
margin-left: 300px;
& :target {
/* Match to where simplebar scrolls */
scroll-margin-top: 20px;
scroll-margin-top: 59px;
}
/* Highlight the headings as well as the first child
of any targeted div, as in the API documentation. */
@ -1061,6 +1060,7 @@ input.new-organization-button {
.app.help {
.markdown {
width: 100vw;
margin-left: 0;
.content {
max-width: none;
@ -1072,7 +1072,7 @@ input.new-organization-button {
display: block;
position: fixed;
top: 70px;
left: 9px;
right: calc(100% - 40px);
fill: hsl(0deg 0% 100%);
z-index: 2;
transition: all 0.3s ease;
@ -1082,7 +1082,7 @@ input.new-organization-button {
.sidebar {
position: fixed;
top: 59px;
right: calc(100vw - 50px);
right: calc(100% - 50px);
width: 100%;
min-width: unset;
height: calc(100vh - 59px);
@ -1102,7 +1102,7 @@ input.new-organization-button {
}
+ .hamburger {
transform: translateX(calc(100vw - 50px));
right: 12px;
}
~ .markdown {