Formatting and more styling of /api

This commit is contained in:
ポール ウェッブ 2018-06-25 12:52:05 -05:00
parent c102e643b8
commit 79127f3503
5 changed files with 498 additions and 1221 deletions

View file

@ -187,10 +187,6 @@
@import "../scss/init/colors";
@import "../scss/init/mixins";
// @import "../scss/partials/slate_variables";
// @import "../scss/partials/slate_icons";
// @import "../scss/partials/slate_style";
.slate {
width: 100%; height: 100%;
position: relative;
@ -234,6 +230,52 @@
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 {
font-size: 1.25rem;
margin-bottom: 0.5rem;
}
h3 {
font-size: 1.15rem;
margin-bottom: 0.25rem;
}
p {
font-size: 1rem;
line-height: 1.5;
margin-bottom: 1rem;
}
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);
}
}
.api__content__body,
@ -246,8 +288,18 @@
}
.api__content__example {
background-color: $black;
background-color: mix($gray, $black, 10%);
border-bottom: 1px solid rgba($white, 0.1);
color: $white;
pre {
margin-bottom: 1rem; padding: 1rem;
background-color: $black;
border-radius: 0.3rem;
line-height: 1.33;
overflow-x: auto;
overflow-y: hidden;
}
}
</style>

File diff suppressed because it is too large Load diff

View file

@ -1,38 +0,0 @@
@font-face {
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
src: url($font-icon-path+".eot?v=#"+$font-icon-version);
src: url($font-icon-path+".eot?#iefix&v=#"+$font-icon-version) format("embedded-opentype"), url($font-icon-path+".woff?v=#"+$font-icon-version) format("woff"), url($font-icon-path+".ttf?v=#"+$font-icon-version) format("truetype"), url($font-icon-path+".svg#fontawesomeregular?v=#"+$font-icon-version) format("svg");;
}
%icon {
font-family: 'FontAwesome';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
}
%icon-exclamation-sign {
@extend %icon;
content: "\f06a";
}
%icon-info-sign {
@extend %icon;
content: "\f05a";
}
%icon-ok-sign {
@extend %icon;
content: "\f058";
}
%icon-search {
@extend %icon;
content: "\f002";
}

View file

@ -1,523 +0,0 @@
/*
Copyright 2008-2013 Concur Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
*/
.slate {
color: $main-text;
padding: 0;
margin: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@extend %default-font;
background-color: $main-bg;
height: 100%;
-webkit-text-size-adjust: none;
/* Never autoresize text */
#toc > ul > li > a > span {
float: right;
background-color: #2484FF;
border-radius: 40px;
width: 20px;
}
@mixin embossed-bg() {
background: linear-gradient(to bottom, rgba(black, 0.2), rgba(black, 0) 8px), linear-gradient(to top, rgba(black, 0.2), rgba(black, 0) 8px), linear-gradient(to bottom, rgba($nav-embossed-border-top, 1), rgba($nav-embossed-border-top, 0) 1.5px), linear-gradient(to top, rgba($nav-embossed-border-bottom, 1), rgba($nav-embossed-border-bottom, 0) 1.5px), $nav-subitem-bg;
}
.tocify-wrapper {
transition: left 0.3s ease-in-out;
overflow-y: auto;
overflow-x: hidden;
position: fixed;
z-index: 30;
top: 64px;
left: 0;
bottom: 0;
width: $nav-width;
background-color: $nav-bg;
font-size: 13px;
font-weight: bold;
.lang-selector {
display: none;
a {
padding-top: 0.5em;
padding-bottom: 0.5em;
}
}
& > img {
display: block;
}
& > .search {
position: relative;
input {
background: $nav-bg;
border-width: 0 0 1px 0;
border-color: $search-box-border-color;
padding: 6px 0 6px 20px;
box-sizing: border-box;
margin: $nav-v-padding $nav-padding;
width: $nav-width - 30;
outline: none;
color: $nav-text;
border-radius: 0;
/* ios has a default border radius */
}
&:before {
position: absolute;
top: 17px;
left: $nav-padding;
color: $nav-text;
@extend %icon-search;
}
}
img+.tocify {
margin-top: $logo-margin;
}
.search-results {
margin-top: 0;
box-sizing: border-box;
height: 0;
overflow-y: auto;
overflow-x: hidden;
transition-property: border-box, border-box;
transition-duration: 180ms;
transition-timing-function: ease-in-out;
&.visible {
height: 30%;
margin-bottom: 1em;
}
@include embossed-bg();
li {
margin: 1em $nav-padding;
line-height: 1;
}
a {
color: $nav-text;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
.tocify-item>a, .toc-footer li {
padding: 0 $nav-padding 0 $nav-padding;
display: block;
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
ul, li {
list-style: none;
margin: 0;
padding: 0;
line-height: 28px;
}
li {
color: $nav-text;
transition-property: relative;
transition-timing-function: linear;
transition-duration: 230ms;
}
.tocify-focus {
box-shadow: 0px 1px 0px $nav-active-shadow;
background-color: $nav-active-bg;
color: $nav-active-text;
}
.tocify-subheader {
display: none;
background-color: $nav-subitem-bg;
font-weight: 500;
.tocify-item>a {
padding-left: $nav-padding + $nav-indent;
font-size: 12px;
}
@include embossed-bg();
& > li:last-child {
box-shadow: none;
}
.tocify-subheader {
display: none;
background-color: $nav-subitem-bg;
font-weight: 500;
.tocify-item>a {
padding-left: $nav-padding + $nav-indent + $nav-indent * 3;
font-size: 12px;
@include embossed-bg();
& > li:last-child {
box-shadow: none;
}
}
.tocify-subheader {
display: none;
background-color: $nav-subitem-bg;
font-weight: 500;
.tocify-item>a {
padding-left: $nav-padding + $nav-indent + $nav-indent * 5;
font-size: 12px;
@include embossed-bg();
& > li:last-child {
box-shadow: none;
}
}
}
}
}
.toc-footer {
padding: 1em 0;
margin-top: 1em;
border-top: 1px dashed $nav-footer-border-color;
li, a {
color: $nav-text;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
li {
font-size: 0.8em;
line-height: 1.7;
text-decoration: none;
}
}
}
#nav-button {
span {
display: block;
$side-pad: $main-padding / 2 - 8px;
padding: $side-pad $side-pad $side-pad;
background-color: rgba($main-bg, 0.7);
transform-origin: 0 0;
transform: rotate(-90deg) translate(-100%, 0);
border-radius: 0 0 0 5px;
}
padding: 0 1.5em 5em 0;
display: none;
position: fixed;
top: 64px;
left: 0;
z-index: 100;
color: #000;
text-decoration: none;
font-weight: bold;
opacity: 0.7;
line-height: 16px;
img {
height: 16px;
vertical-align: 0;
}
transition: 0 0.3s ease-in-out;
&:hover {
opacity: 1;
}
&.open {
left: $nav-width;
}
}
.page-wrapper {
margin-left: $nav-width;
position: relative;
z-index: 10;
background-color: $main-bg;
min-height: 100%;
padding-bottom: 1px;
.dark-box {
width: $examples-width;
background-color: $examples-bg;
position: absolute;
right: 0;
top: 0;
bottom: 0;
}
.lang-selector {
position: fixed;
z-index: 50;
border-bottom: 5px solid $lang-select-active-bg;
}
}
.lang-selector {
background-color: $lang-select-bg;
width: 100%;
font-weight: bold;
a {
display: block;
float: 1;
color: $lang-select-text;
text-decoration: none;
padding: 0 10px;
line-height: 30px;
outline: 0;
&:active, &:focus {
background-color: $lang-select-pressed-bg;
color: $lang-select-pressed-text;
}
&.active {
background-color: $lang-select-active-bg;
color: $lang-select-active-text;
}
}
&:after {
content: '';
clear: both;
display: block;
}
}
.content {
position: relative;
z-index: 30;
&:after {
content: '';
display: block;
clear: both;
}
& > h1, & > h2, & > h3, & > h4, & > h5, & > h6, & > p, & > table, & > ul, & > ol, & > aside, & > dl {
margin-right: $examples-width;
padding: 0 $main-padding;
box-sizing: border-box;
display: block;
text-shadow: $main-embossed-text-shadow;
}
& > ul, & > ol {
padding-left: $main-padding + 15px;
}
& > h1, & > h2, & > div {
clear: both;
}
h1 {
@extend %header-font;
font-size: 30px;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-bottom: 1px solid #ccc;
margin-bottom: $h1-margin-bottom;
margin-top: 2em;
border-top: 1px solid #ddd;
background-image: linear-gradient(to bottom, white, #f9f9f9);
}
h1:first-child, div:first-child + h1 {
border-top-width: 0;
margin-top: 0;
}
h2 {
@extend %header-font;
font-size: 20px;
margin-top: 4em;
margin-bottom: 0;
border-top: 1px solid #ccc;
padding-top: 1.2em;
padding-bottom: 1.2em;
background-image: linear-gradient(to bottom, rgba(white, 0.4), rgba(white, 0));
}
h1 + h2, h1 + div + h2 {
margin-top: $h1-margin-bottom * -1;
border-top: none;
}
h3, h4, h5, h6 {
@extend %header-font;
font-size: 15px;
margin-top: 2.5em;
margin-bottom: 0.8em;
}
h4, h5, h6 {
font-size: 10px;
}
hr {
margin: 2em 0;
border-top: 2px solid $examples-bg;
border-bottom: 2px solid $main-bg;
}
table {
margin-bottom: 1em;
overflow: auto;
width: auto;
th, td {
text-align: 1;
vertical-align: 0;
line-height: 1.6;
&:nth-of-type(1) {
text-align: right !important;
font-weight: bold;
}
em {
display: block;
text-transform: uppercase;
color: #e69731;
font-size: 0.75rem;
font-style: normal;
}
}
th {
padding: 5px 10px;
border-bottom: 1px solid #ccc;
vertical-align: 0;
}
td {
padding: 10px;
}
tr:last-child {
border-bottom: 1px solid #ccc;
}
tr:nth-child(odd) > td {
background-color: lighten($main-bg, 4.2%);
}
tr:nth-child(even) > td {
background-color: lighten($main-bg, 2.4%);
}
}
dt {
font-weight: bold;
}
dd {
margin-left: 15px;
}
p, li, dt, dd {
line-height: 1.6;
margin-top: 0;
}
img {
max-width: 100%;
}
code {
background-color: rgba(0, 0, 0, 0.05);
padding: 3px;
border-radius: 3px;
@extend %break-words;
@extend %code-font;
}
pre>code {
background-color: transparent;
padding: 0;
}
aside {
padding-top: 1em;
padding-bottom: 1em;
text-shadow: 0 1px 0 lighten($aside-notice-bg, 15%);
margin-top: 1.5em;
margin-bottom: 1.5em;
background: $aside-notice-bg;
line-height: 1.6;
&.warning {
background-color: $aside-warning-bg;
text-shadow: 0 1px 0 lighten($aside-warning-bg, 15%);
}
&.success {
background-color: $aside-success-bg;
text-shadow: 0 1px 0 lighten($aside-success-bg, 15%);
}
}
aside:before {
vertical-align: middle;
padding-right: 0.5em;
font-size: 14px;
}
aside.notice:before {
@extend %icon-info-sign;
}
aside.warning:before {
@extend %icon-exclamation-sign;
}
aside.success:before {
@extend %icon-ok-sign;
}
.search-highlight {
padding: 2px;
margin: -2px;
border-radius: 4px;
border: 1px solid #F7E633;
text-shadow: 1px 1px 0 #666666;
background: linear-gradient(to top left, #f7e633 0%, #f1d32f 100%);
}
}
.content {
pre, blockquote {
background-color: $code-bg;
color: #fff;
padding: 2em $main-padding;
margin: 0;
width: $examples-width;
float: right;
clear: right;
box-sizing: border-box;
text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.4);
& > p {
margin: 0;
}
a {
color: #fff;
text-decoration: none;
border-bottom: dashed 1px #ccc;
}
}
pre {
@extend %code-font;
}
blockquote {
& > p {
background-color: $code-annotation-bg;
border-radius: 5px;
padding: $code-annotation-padding;
color: #ccc;
border-top: 1px solid #000;
border-bottom: 1px solid #404040;
}
}
}
@media (max-width: $tablet-width) {
.tocify-wrapper {
left: -1 * $nav-width;
&.open {
left: 0;
}
}
.page-wrapper {
margin-left: 0;
}
#nav-button {
display: block;
}
.tocify-wrapper .tocify-item > a {
padding-top: 0.3em;
padding-bottom: 0.3em;
}
}
@media (max-width: $phone-width) {
.dark-box {
display: none;
}
.tocify-wrapper .lang-selector {
display: block;
}
.page-wrapper .lang-selector {
display: none;
}
.content {
h1, h2, h3, h4, h5, h6, p, table, ul, ol, aside, dl {
margin-right: 0;
}
pre, blockquote {
float: none;
width: auto;
}
}
}
}

View file

@ -1,146 +0,0 @@
/*
Copyright 2008-2013 Concur Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
*/
////////////////////////////////////////////////////////////////////////////////
// CUSTOMIZE WHITEBOARD
//
// Use these settings to help adjust the appearance of Whiteboard
////////////////////////////////////////////////////////////////////////////////
////////////////////
// BACKGROUND COLORS
////////////////////
$nav-bg: #393939;
$examples-bg: #393939;
$code-bg: #292929;
$code-annotation-bg: #1c1c1c;
$nav-subitem-bg: #262626;
$nav-active-bg: #2467af;
$lang-select-border: black;
$lang-select-bg: #222222;
// feel free to change this to blue or something
$lang-select-active-bg: $examples-bg;
// color of language tab bg when mouse is pressed
$lang-select-pressed-bg: #111111;
$main-bg: #eaf2f6;
$aside-notice-bg: #8fbcd4;
$aside-warning-bg: #c97a7e;
$aside-success-bg: #6ac174;
$search-notice-bg: #c97a7e;
////////////////////
// TEXT COLORS
////////////////////
// main content text color
$main-text: #333333;
// color of unselected language tab text
$nav-text: white;
$nav-active-text: white;
$lang-select-text: white;
// color of selected language tab text
$lang-select-active-text: white;
// color of language tab text when mouse is pressed
$lang-select-pressed-text: white;
////////////////////
// SIZES
////////////////////
// width of the navbar
$nav-width: 230px;
// portion of the screen taken up by code examples
$examples-width: 50%;
// margin between nav items and logo, ignored if search is active
$logo-margin: 20px;
// padding to left and right of content & examples
$main-padding: 28px;
// padding to left and right of navbar
$nav-padding: 15px;
// padding used vertically around search boxes and results
$nav-v-padding: 10px;
// extra padding for ToC subitems
$nav-indent: 10px;
// padding inside code annotations
$code-annotation-padding: 13px;
// padding under the largest header tags
$h1-margin-bottom: 21px;
// min width before reverting to tablet size
$tablet-width: 930px;
// min width before reverting to mobile size
$phone-width: $tablet-width - $nav-width;
////////////////////
// FONTS
////////////////////
%default-font {
font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif;
font-size: 13px;
}
%header-font {
@extend %default-font;
font-weight: bold;
}
%code-font {
font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;
font-size: 12px;
line-height: 1.5;
}
$font-icon: FontAwesome;
$font-icon-path: "../public/fonts/fontawesome-webfont";
$font-icon-version: "4.0.3";
////////////////////
// OTHER
////////////////////
$nav-active-shadow: black;
$nav-footer-border-color: #666666;
$nav-embossed-border-top: black;
$nav-embossed-border-bottom: #939393;
$main-embossed-text-shadow: 0px 1px 0px white;
$search-box-border-color: #666666;
////////////////////////////////////////////////////////////////////////////////
// INTERNAL
////////////////////////////////////////////////////////////////////////////////
// These settings are probably best left alone.
%break-words {
word-break: break-all;
/* Non standard for webkit */
word-break: break-word;
hyphens: auto;
}