lbry.tech/app/sass/pages/_api.scss

248 lines
3.8 KiB
SCSS
Raw Normal View History

2018-10-06 00:46:08 +02:00
/*!
* API Wrapper
*
* @class .__slate
* @selector {::after}
2018-10-06 00:46:08 +02:00
**/
2018-08-01 00:10:10 +02:00
.__slate {
2018-09-30 19:34:29 +02:00
width: 100%;
height: 100%;
2018-08-01 00:10:10 +02:00
position: relative;
&::after {
@include clearfix;
}
}
2018-10-03 22:27:13 +02:00
.api__header {
2018-10-01 06:40:24 +02:00
padding: 2rem;
2018-10-03 22:27:13 +02:00
position: relative;
&::after {
width: 100%; height: 1px;
bottom: -1px; left: 0;
2018-10-13 00:29:53 +02:00
background-color: $lbry-gray-2;
2018-10-03 22:27:13 +02:00
content: "";
position: absolute;
}
2018-09-30 19:34:29 +02:00
}
2018-08-01 00:10:10 +02:00
2018-10-06 00:46:08 +02:00
/*!
* 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}
2018-10-06 00:46:08 +02:00
**/
2018-08-01 00:10:10 +02:00
.api__toc {
width: 200px; height: calc(100vh - 4rem); // navigation is 4rem tall
2018-10-06 00:46:08 +02:00
bottom: 0; left: 0;
2018-08-01 00:10:10 +02:00
2018-10-13 00:29:53 +02:00
background-color: $lbry-white;
border-right: 1px solid $lbry-gray-1;
2018-08-01 00:10:10 +02:00
float: left;
overflow-x: hidden;
overflow-y: auto;
position: fixed;
z-index: 3;
}
.api__toc__search {
position: relative;
}
.api__toc__search__field {
2018-10-06 00:46:08 +02:00
width: 100%;
padding: 0.25rem calc(2rem + 4px) 0.25rem 0.75rem;
2018-10-13 00:29:53 +02:00
border-bottom: 1px solid $lbry-gray-1;
2018-08-02 00:18:39 +02:00
font-size: 0.8rem;
2018-08-01 00:10:10 +02:00
line-height: 2rem;
}
.api__toc__search__clear {
width: 1.25rem; height: 1.25rem;
top: 0.6rem; right: 0.75rem;
2018-10-13 00:29:53 +02:00
background-color: $lbry-black;
2018-08-01 00:10:10 +02:00
border-radius: 50%;
2018-10-13 00:29:53 +02:00
color: $lbry-white;
2018-08-01 00:10:10 +02:00
cursor: pointer;
font-size: 1rem;
2018-08-02 00:18:39 +02:00
line-height: 1.15;
2018-08-01 00:10:10 +02:00
position: absolute;
text-align: center;
transition: opacity 0.2s;
&:not(.active) {
opacity: 0;
visibility: hidden;
}
&.active {
opacity: 1;
visibility: visible;
}
}
.api__toc__items {
font-size: 0.8rem;
line-height: 1.33;
list-style-type: none;
2018-08-01 00:10:10 +02:00
padding-top: 0.25rem;
2018-10-31 17:06:30 +01:00
padding-bottom: 1rem;
}
2018-08-01 00:10:10 +02:00
.api__toc__item {
&:hover {
2018-10-13 00:29:53 +02:00
background-color: $lbry-gray-2;
2018-08-01 00:10:10 +02:00
}
a {
padding: 0.25rem 0.5rem 0.25rem 0.75rem;
2018-10-06 00:46:08 +02:00
display: block;
}
2018-08-01 00:10:10 +02:00
}
.api__content {
width: calc(100% - 200px);
2018-10-06 00:46:08 +02:00
float: right;
2018-10-01 06:40:24 +02:00
}
.api__documentation {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
2018-08-01 00:10:10 +02:00
h1 {
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
h2 {
2018-08-02 18:22:52 +02:00
font-size: 1.5rem;
2018-08-01 00:10:10 +02:00
margin-bottom: 0.5rem;
}
h3 {
2018-08-01 18:49:22 +02:00
font-size: 0.8rem;
letter-spacing: 0.1rem;
2018-08-01 00:10:10 +02:00
margin-bottom: 0.25rem;
2018-08-01 18:49:22 +02:00
text-transform: uppercase;
2018-08-01 00:10:10 +02:00
}
2018-10-06 00:46:08 +02:00
p,
ol,
ul {
2018-08-01 00:10:10 +02:00
font-size: 1rem;
line-height: 1.5;
margin-bottom: 1rem;
}
2018-09-27 18:11:26 +02:00
pre {
font-size: 0.8rem;
}
2018-08-01 00:10:10 +02:00
table {
2018-10-06 00:46:08 +02:00
width: 100%;
2018-10-13 00:29:53 +02:00
border: 1px solid rgba($lbry-white, 0.1);
2018-08-01 00:10:10 +02:00
border-radius: 0.3rem;
border-spacing: 0;
font-size: 0.8rem;
line-height: 1.33;
}
thead {
display: none;
}
2018-10-06 00:46:08 +02:00
th,
td {
2018-08-01 00:10:10 +02:00
padding: 0.5rem 1rem 0.5rem 0.5rem;
}
th {
2018-10-13 00:29:53 +02:00
border-bottom: 1px solid rgba($lbry-white, 0.1);
2018-08-01 00:10:10 +02:00
}
tr:nth-child(even) {
2018-10-13 00:29:53 +02:00
background-color: rgba($lbry-white, 0.1);
2018-08-01 00:10:10 +02:00
}
2018-08-01 18:49:22 +02:00
}
2018-08-02 18:22:52 +02:00
.api__content__body {
padding: 2rem;
2018-10-13 00:29:53 +02:00
border-bottom: 1px solid $lbry-gray-1; // rgba($lbry-gray-1, 0.3);
2018-08-02 18:22:52 +02:00
}
2018-08-01 18:49:22 +02:00
.api__content__body__arguments {
2018-10-13 00:29:53 +02:00
border: 1px solid $lbry-gray-2;
2018-08-01 18:49:22 +02:00
border-radius: 3px;
list-style-type: none;
}
.api__content__body__argument {
&:not(:last-of-type) {
2018-10-13 00:29:53 +02:00
border-bottom: 1px solid $lbry-gray-2;
2018-08-01 18:49:22 +02:00
}
&:nth-child(even) {
2018-10-13 00:29:53 +02:00
background-color: rgba($lbry-gray-1, 0.2);
2018-08-01 18:49:22 +02:00
}
.left,
.right {
padding: 0.5rem 0.75rem;
}
.left {
2018-10-06 00:46:08 +02:00
width: 30%;
2018-10-13 00:29:53 +02:00
border-right: 1px solid $lbry-gray-2;
2018-10-02 22:28:27 +02:00
float: left;
2018-08-01 18:49:22 +02:00
word-wrap: break-word;
span {
2018-10-13 00:29:53 +02:00
color: $lbry-gray-3;
2018-08-01 18:49:22 +02:00
font-size: 0.8rem;
&:not(:first-of-type) {
margin-left: 0.5rem;
}
}
}
.right {
width: 70%;
2018-10-06 00:46:08 +02:00
float: right;
2018-08-01 18:49:22 +02:00
}
&::after {
@include clearfix;
}
2018-08-01 00:10:10 +02:00
}
.api__content__example {
2018-10-06 00:46:08 +02:00
padding: 2rem;
2018-10-13 00:29:53 +02:00
background-color: rgba($lbry-black, 0.9);
border-bottom: 1px solid rgba($lbry-white, 0.1);
color: $lbry-white;
2018-08-02 18:22:52 +02:00
pre {
2018-10-13 00:29:53 +02:00
background-color: $lbry-black;
2018-08-02 18:22:52 +02:00
}
2018-08-01 00:10:10 +02:00
}