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

303 lines
4.5 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;
}
}
2019-01-30 23:15:10 +01: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
*
2019-01-30 23:15:10 +01:00
* @class .api-toc
* @class .api-toc__search
* @class .api-toc__search-field
*
2019-01-30 23:15:10 +01:00
* @class .api-toc__search-clear
* @state {.active}
*
2019-01-30 23:15:10 +01:00
* @class .api-toc__items
*
2019-01-30 23:15:10 +01:00
* @class .api-toc__item
* @state {:hover}
2018-10-06 00:46:08 +02:00
**/
2019-01-30 23:15:10 +01:00
.api-toc {
2018-08-01 00:10:10 +02:00
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-12-12 18:15:27 +01:00
// float: left;
2018-08-01 00:10:10 +02:00
overflow-x: hidden;
overflow-y: auto;
position: fixed;
z-index: 3;
}
2019-01-30 23:15:10 +01:00
.api-toc__search {
2018-08-01 00:10:10 +02:00
position: relative;
}
2019-01-30 23:15:10 +01:00
.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;
}
2019-01-30 23:15:10 +01:00
.api-toc__search-clear {
2018-08-01 00:10:10 +02:00
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;
}
}
2019-01-30 23:15:10 +01:00
.api-toc__items {
2018-08-01 00:10:10 +02:00
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
2019-01-30 23:15:10 +01: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
}
2019-01-30 23:15:10 +01:00
.api-content {
2018-08-01 00:10:10 +02:00
width: calc(100% - 200px);
2018-10-06 00:46:08 +02:00
float: right;
2018-10-01 06:40:24 +02:00
}
2019-01-30 23:15:10 +01:00
.api-documentation {
2018-10-01 06:40:24 +02:00
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
}
2019-01-30 23:15:10 +01:00
.api-content__body {
2018-08-02 18:22:52 +02:00
padding: 2rem;
2019-01-30 23:15:10 +01:00
border-bottom: 1px solid $lbry-gray-1;
a {
transition: color 0.2s;
&:not(:hover) {
color: $lbry-teal-3;
}
&:hover {
color: $lbry-teal-5;
}
}
2018-08-02 18:22:52 +02:00
}
2019-01-30 23:15:10 +01: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;
}
2019-01-30 23:15:10 +01:00
.api-content__body-argument {
2018-08-01 18:49:22 +02:00
&: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
}
2019-01-30 23:15:10 +01:00
.api-content__example,
.api-content__intro {
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;
2019-01-30 23:15:10 +01:00
position: relative;
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
}
2019-01-30 23:15:10 +01:00
.api-content__items {
width: 100%;
padding: 1rem 2rem;
top: 4rem; right: 0;
background-color: $lbry-black;
2019-01-31 00:17:42 +01:00
color: $lbry-white;
2019-01-30 23:15:10 +01:00
position: sticky;
z-index: 10;
}
.api-content__item {
padding: 0.25rem 0.75rem;
border-radius: 0.2rem;
display: inline-block;
font-size: 0.8rem;
transition: background-color 0.2s;
&:not(:last-of-type) {
margin-right: 0.5rem;
}
&:not(:hover) {
background-color: $lbry-gray-5;
}
&.active,
&:hover {
background-color: $lbry-teal-4;
}
}
pre {
&[data-api-example-type] {
&:not(.active) {
display: none;
}
}
}