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

248 lines
3.8 KiB
SCSS
Raw Normal View History

/**
* API Wrapper
*
* @class .__slate
* @selector {::after}
*/
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-09-30 19:34:29 +02:00
.api__header
{
color: red;
}
2018-08-01 00:10:10 +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-08-01 00:10:10 +02:00
.api__toc {
width: 200px; height: calc(100vh - 4rem); // navigation is 4rem tall
2018-09-30 19:34:29 +02:00
left: 0; bottom: 0;
2018-08-01 00:10:10 +02:00
background-color: $white;
border-right: 1px solid rgba($gray, 0.3);
float: left;
overflow-x: hidden;
overflow-y: auto;
position: fixed;
z-index: 3;
}
.api__toc__search {
position: relative;
}
.api__toc__search__field {
border-bottom: 1px solid rgba($gray, 0.3);
2018-08-02 00:18:39 +02:00
font-size: 0.8rem;
2018-08-01 00:10:10 +02:00
line-height: 2rem;
2018-08-02 00:18:39 +02:00
padding: 0.25rem calc(2rem + 4px) 0.25rem 0.75rem;
2018-08-01 00:10:10 +02:00
width: 100%;
}
.api__toc__search__clear {
width: 1.25rem; height: 1.25rem;
top: 0.6rem; right: 0.75rem;
background-color: $black;
border-radius: 50%;
color: $white;
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;
padding-bottom: 0.25rem;
}
2018-08-01 00:10:10 +02:00
.api__toc__item {
&:hover {
background-color: rgba($gray, 0.3);
2018-08-01 00:10:10 +02:00
}
a {
display: block;
padding: 0.25rem 0.5rem 0.25rem 0.75rem;
}
2018-08-01 00:10:10 +02:00
}
/**
* API | Main Content
*
* @class .api__content
* @class .api__content__body
* @class .api__content__body__arguments
*
* @class .api__content__body__argument
* @selector {::after}
* @selector {:last-of-type}
* @selector {:nth-child}
*
* @class .api__content__example
*/
2018-08-01 00:10:10 +02:00
.api__content {
display: grid;
float: right;
grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
width: calc(100% - 200px);
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
}
p, ol, ul {
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 {
border: 1px solid rgba($white, 0.1);
border-radius: 0.3rem;
border-spacing: 0;
font-size: 0.8rem;
line-height: 1.33;
width: 100%;
}
thead {
display: none;
}
th, td {
padding: 0.5rem 1rem 0.5rem 0.5rem;
}
th {
border-bottom: 1px solid rgba($white, 0.1);
}
tr:nth-child(even) {
background-color: rgba($white, 0.1);
}
2018-08-01 18:49:22 +02:00
}
2018-08-02 18:22:52 +02:00
.api__content__body {
border-bottom: 1px solid rgba($gray, 0.3);
padding: 2rem;
pre {
border: 1px solid rgba($gray, 0.3);
}
}
2018-08-01 18:49:22 +02:00
.api__content__body__arguments {
border: 1px solid rgba($gray, 0.3);
border-radius: 3px;
list-style-type: none;
}
.api__content__body__argument {
&:not(:last-of-type) {
border-bottom: 1px solid rgba($gray, 0.3);
}
&:nth-child(even) {
background-color: rgba($gray, 0.1);
}
.left,
.right {
padding: 0.5rem 0.75rem;
}
.left {
border-right: 1px solid rgba($gray, 0.3);
width: 30%;
word-wrap: break-word;
span {
color: $gray;
font-size: 0.8rem;
&:not(:first-of-type) {
margin-left: 0.5rem;
}
}
}
.right {
width: 70%;
}
&::after {
@include clearfix;
}
2018-08-01 00:10:10 +02:00
}
.api__content__example {
background-color: mix($gray, $black, 10%);
border-bottom: 1px solid rgba($white, 0.1);
color: $white;
2018-08-02 18:22:52 +02:00
padding: 2rem;
pre {
background-color: $black;
}
2018-08-01 00:10:10 +02:00
}