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

362 lines
5.4 KiB
SCSS
Raw Normal View History

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
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
2019-05-14 21:40:35 +02:00
bottom: 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
overflow-x: hidden;
overflow-y: auto;
position: fixed;
z-index: 3;
2019-02-20 00:42:52 +01:00
2019-05-14 21:40:35 +02:00
@media (min-width: 801px) {
left: 0;
}
2019-02-20 00:42:52 +01:00
@media (max-width: 800px) {
2019-05-14 21:40:35 +02:00
height: calc(100% - 4rem);
top: 4rem;
padding-top: 3.5rem;
transition: left 0.2s;
-webkit-overflow-scrolling: touch;
&:not(.active) {
left: -200px;
}
&.active {
left: 0;
}
2019-02-20 00:42:52 +01:00
}
2018-08-01 00:10:10 +02:00
}
2019-07-10 19:34:19 +02:00
.api-toc__select,
2019-01-30 23:15:10 +01:00
.api-toc__search-field {
2018-10-06 00:46:08 +02:00
width: 100%;
2019-07-08 21:30:37 +02:00
border-top: none;
border-right: none;
2018-10-13 00:29:53 +02:00
border-bottom: 1px solid $lbry-gray-1;
2019-07-08 21:30:37 +02:00
border-left: none;
2019-07-10 19:34:19 +02:00
}
.api-toc__select {
background-position-x: 95%;
}
.api-toc__search {
position: relative;
}
.api-toc__search-field {
padding: 0.25rem calc(2rem + 4px) 0.25rem 0.75rem;
2019-02-20 00:42:52 +01:00
border-radius: 0; // TODO: Put this rule in components on inputs
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-04-12 21:08:35 +02:00
.api-toc__title {
padding: 0.25rem 0.5rem 0.25rem 0.75rem;
opacity: 0.3;
pointer-events: none;
text-transform: uppercase;
}
.api-toc__commands {
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-04-12 21:08:35 +02:00
.api-toc__command {
&: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 {
2019-02-20 00:42:52 +01:00
@media (min-width: 801px) {
width: calc(100% - 200px);
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;
2019-02-20 00:42:52 +01:00
@media (min-width: 1201px) {
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;
}
}
}
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
line-height: 1.5;
margin-bottom: 1rem;
}
2019-02-20 00:42:52 +01:00
ol,
ul {
@media (min-width: 801px) {
font-size: 1rem;
}
@media (max-width: 800px) {
font-size: 0.8rem;
}
}
p {
font-size: 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 {
2019-04-12 21:08:35 +02:00
display: flex;
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-02 22:28:27 +02:00
float: left;
2018-08-01 18:49:22 +02:00
word-wrap: break-word;
2019-02-20 00:42:52 +01:00
@media (min-width: 801px) {
border-right: 1px solid $lbry-gray-2;
}
2018-08-01 18:49:22 +02:00
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;
2019-05-14 21:40:35 +02:00
word-wrap: break-word;
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;
2019-02-20 00:42:52 +01:00
// GOOD OL' SAFARI
position: -webkit-sticky; // sass-lint:disable-line no-duplicate-properties
2019-01-30 23:15:10 +01:00
}
.api-content__item {
padding: 0.25rem 0.75rem;
border-radius: 0.2rem;
display: inline-block;
font-size: 0.8rem;
transition: background-color 0.2s;
2019-05-14 21:40:35 +02:00
&.menu {
@media (min-width: 801px) {
display: none;
}
}
2019-01-30 23:15:10 +01:00
&: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;
}
}
}