Doc pages are looking good on mobile

This commit is contained in:
ポール ウェッブ 2019-02-19 17:42:52 -06:00
parent fa2b455037
commit 50db2fbe81
4 changed files with 62 additions and 36 deletions

View file

@ -1,10 +1,3 @@
/*!
* API Wrapper
*
* @class .__slate
* @selector {::after}
**/
.__slate { .__slate {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -29,34 +22,20 @@
} }
} }
/*!
* API | Table of Contents
*
* @class .api-toc
* @class .api-toc__search
* @class .api-toc__search-field
*
* @class .api-toc__search-clear
* @state {.active}
*
* @class .api-toc__items
*
* @class .api-toc__item
* @state {:hover}
**/
.api-toc { .api-toc {
width: 200px; height: calc(100vh - 4rem); // navigation is 4rem tall width: 200px; height: calc(100vh - 4rem); // navigation is 4rem tall
bottom: 0; left: 0; bottom: 0; left: 0;
background-color: $lbry-white; background-color: $lbry-white;
border-right: 1px solid $lbry-gray-1; border-right: 1px solid $lbry-gray-1;
// float: left;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
position: fixed; position: fixed;
z-index: 3; z-index: 3;
@media (max-width: 800px) {
display: none;
}
} }
.api-toc__search { .api-toc__search {
@ -68,6 +47,7 @@
padding: 0.25rem calc(2rem + 4px) 0.25rem 0.75rem; padding: 0.25rem calc(2rem + 4px) 0.25rem 0.75rem;
border-bottom: 1px solid $lbry-gray-1; border-bottom: 1px solid $lbry-gray-1;
border-radius: 0; // TODO: Put this rule in components on inputs
font-size: 0.8rem; font-size: 0.8rem;
line-height: 2rem; line-height: 2rem;
} }
@ -117,13 +97,28 @@
} }
.api-content { .api-content {
@media (min-width: 801px) {
width: calc(100% - 200px); width: calc(100% - 200px);
float: right; float: right;
} }
}
.api-documentation { .api-documentation {
display: grid; display: grid;
@media (min-width: 1201px) {
grid-template-columns: repeat(auto-fit, minmax(50%, 1fr)); grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
}
@media (max-width: 1200px) {
grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
div {
&:empty {
display: none;
}
}
}
h1 { h1 {
font-size: 1.5rem; font-size: 1.5rem;
@ -145,11 +140,25 @@
p, p,
ol, ol,
ul { ul {
font-size: 1rem;
line-height: 1.5; line-height: 1.5;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
ol,
ul {
@media (min-width: 801px) {
font-size: 1rem;
}
@media (max-width: 800px) {
font-size: 0.8rem;
}
}
p {
font-size: 1rem;
}
pre { pre {
font-size: 0.8rem; font-size: 0.8rem;
} }
@ -221,11 +230,13 @@
.left { .left {
width: 30%; width: 30%;
border-right: 1px solid $lbry-gray-2;
float: left; float: left;
word-wrap: break-word; word-wrap: break-word;
@media (min-width: 801px) {
border-right: 1px solid $lbry-gray-2;
}
span { span {
color: $lbry-gray-3; color: $lbry-gray-3;
font-size: 0.8rem; font-size: 0.8rem;
@ -270,6 +281,9 @@
color: $lbry-white; color: $lbry-white;
position: sticky; position: sticky;
z-index: 10; z-index: 10;
// GOOD OL' SAFARI
position: -webkit-sticky; // sass-lint:disable-line no-duplicate-properties
} }
.api-content__item { .api-content__item {

View file

@ -3,9 +3,11 @@
.glossary { .glossary {
main { main {
@media (min-width: 801px) {
width: calc(100vw - 200px); width: calc(100vw - 200px);
margin-left: 200px; margin-left: 200px;
} }
}
.page__header-wrap, .page__header-wrap,
.page__content { .page__content {
@ -31,6 +33,10 @@
position: fixed; position: fixed;
z-index: 1; z-index: 1;
@media (max-width: 800px) {
display: none;
}
li { li {
list-style-type: none !important; list-style-type: none !important;

View file

@ -1,11 +1,17 @@
pre { pre {
padding: 2rem;
line-height: 1.33; line-height: 1.33;
margin-bottom: 2rem; margin-bottom: 2rem;
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
@media (min-width: 801px) {
padding: 2rem;
}
@media (max-width: 800px) {
padding: 1rem;
}
&:not([class]), &:not([class]),
&.language-text { &.language-text {
background-color: #27283e; background-color: #27283e;

View file

@ -49,7 +49,7 @@ export default async(state) => {
</aside> </aside>
<section class="api-content"> <section class="api-content">
<div class="api-documentation" id="toc-content"> <div class="api-documentation" id="toc-content">
<div>&nbsp;</div> <div></div>
<nav class="api-content__items"> <nav class="api-content__items">
<button class="api-content__item" id="toggle-curl" type="button">curl</button> <button class="api-content__item" id="toggle-curl" type="button">curl</button>
<button class="api-content__item" id="toggle-lbrynet" type="button">lbrynet</button> <button class="api-content__item" id="toggle-lbrynet" type="button">lbrynet</button>