Global styles and Menu style

This commit is contained in:
Cesar 2016-03-02 14:48:55 -05:00
parent d07e2f0026
commit 06cba79383
9 changed files with 291 additions and 288 deletions

View File

@ -23,7 +23,7 @@ $base-font : Roboto;
$base-font-family : sans-serif; $base-font-family : sans-serif;
$base-font-weight : $regular; $base-font-weight : $regular;
$base-font-size : 1em; $base-font-size : 1em;
$base-line-height : 1.4; $base-line-height : 1.55em;
$text-color : $black; $text-color : $black;
// Heading Font // Heading Font
@ -37,7 +37,7 @@ $h1: 1.85714285714286em;
$h2: 1.5714285714285714em; $h2: 1.5714285714285714em;
$h3: 1.2857142857142858em; $h3: 1.2857142857142858em;
$h4: 1.1428571428571428em; $h4: 1.1428571428571428em;
$h5: 1em; $h5: 0.929em;
// Google Fonts // Google Fonts
// --------------------------- // ---------------------------
@ -50,7 +50,7 @@ $side-bar-width: 260px;
$side-bar-bg-color: #FAFAFA; $side-bar-bg-color: #FAFAFA;
$side-menu-item-color: #384248; $side-menu-item-color: #384248;
$side-menu-even-bg-color: #F0F0F0; $side-menu-even-bg-color: #F0F0F0;
$side-menu-active-bg-color: #DEDEDE; $side-menu-active-bg-color: #f0f0f0;
$side-menu-item-hpadding: 20px; $side-menu-item-hpadding: 20px;
$side-menu-item-vpadding: 5px; $side-menu-item-vpadding: 5px;
@ -68,40 +68,3 @@ $side-menu-mobile-breakpoint: 1000px;
// Border Radius // Border Radius
// --------------------------- // ---------------------------
$border-radius: 2px; $border-radius: 2px;
// Global Styles
// ---------------------------
@for $index from 1 through 5 {
h#{$index}{
margin-top: 0;
font-family: $headers-font, $headers-font-family;
color: $headers-color;
font-weight: $headers-font-weight;
}
}
h1 { font-size: $h1; }
h2 { font-size: $h2; }
h3 { font-size: $h3; }
h4 { font-size: $h4; }
h5 { font-size: $h5; }
p {
font-size: $base-font-size;
}
footer {
text-align: right;
padding: 10px;
font-size: 15px;
a {
color: #999;
text-decoration: none;
}
strong {
font-size: 18px;
color: $headers-color;
}
}

View File

@ -35,7 +35,7 @@ $sub-schema-offset: ($bullet-size/2) + $bullet-margin;
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
padding: $cell-padding 0 $cell-padding 0; padding: $cell-padding 0 $cell-padding 0;
font-weight: bold; font-weight: $regular;
box-sizing: border-box; box-sizing: border-box;
line-height: $param-name-height; line-height: $param-name-height;
border-left: $line-border; border-left: $line-border;
@ -76,7 +76,7 @@ $sub-schema-offset: ($bullet-size/2) + $bullet-margin;
font-size: 12px; font-size: 12px;
line-height: $param-name-height; line-height: $param-name-height;
vertical-align: middle; vertical-align: middle;
font-weight: bold; font-weight: normal;
} }
.param-type.array:before { .param-type.array:before {

View File

@ -12,7 +12,7 @@ responses-list, params-list {
} }
.method-header { .method-header {
margin-bottom: .5em; margin-bottom: .9em;
} }
.method-endpoint { .method-endpoint {
@ -22,8 +22,8 @@ responses-list, params-list {
} }
.method-endpoint > h5 { .method-endpoint > h5 {
padding-top: 4px; padding-top: 1px;
padding-bottom: 3px; padding-bottom: 0;
margin: 0; margin: 0;
font-size: .8em; font-size: .8em;
vertical-align: middle; vertical-align: middle;
@ -32,11 +32,11 @@ responses-list, params-list {
} }
.api-url { .api-url {
color: lighten($text-color, 30%); color: rgba($text-color, .6);
margin-left: 10px; margin-left: 10px;
margin-top: 2px; margin-top: 2px;
position: relative; position: relative;
top: 1px; top: 2px;
font-size: 1em!important; font-size: 1em!important;
} }

View File

@ -1,4 +1,4 @@
<h4 class="param-list-header" *ngIf="data.params.length"> Parameters </h4> <h5 class="param-list-header" *ngIf="data.params.length"> Parameters </h5>
<template ngFor [ngForOf]="data.params" #paramType="$implicit"> <template ngFor [ngForOf]="data.params" #paramType="$implicit">
<header class="paramType"> {{paramType.place}} Parameters </header> <header class="paramType"> {{paramType.place}} Parameters </header>
<br> <br>
@ -23,7 +23,7 @@
</template> </template>
<div *ngIf="data.bodyParam"> <div *ngIf="data.bodyParam">
<h4 class="param-list-header" *ngIf="data.bodyParam"> Request Body </h4> <h5 class="param-list-header" *ngIf="data.bodyParam"> Request Body </h5>
<div class="body-param-description" innerHtml="{{data.bodyParam.description | marked}}"></div> <div class="body-param-description" innerHtml="{{data.bodyParam.description | marked}}"></div>
<div> <div>

View File

@ -1,10 +1,10 @@
@import '../../common/styles/variables'; @import '../../common/styles/variables';
.param-list-header { .param-list-header {
border-bottom: 1px solid lighten($text-color, 60%); border-bottom: 1px solid rgba($text-color, .3);
padding: 0.2em 0; padding: 0.2em 0;
margin: 3em 0 .5em 0; margin: 3.5em 0 .8em 0;
color: $text-color; color: rgba($text-color, .5);
font-weight: normal; font-weight: normal;
text-transform: uppercase; text-transform: uppercase;
} }

View File

@ -81,11 +81,53 @@ api-logo {
/* global redoc styles */ /* global redoc styles */
:host p { @for $index from 1 through 5 {
:host h#{$index}{
margin-top: 0;
font-family: $headers-font, $headers-font-family;
color: $headers-color;
font-weight: $headers-font-weight;
}
}
:host {
h1 { font-size: $h1; }
h2 { font-size: $h2; }
h3 { font-size: $h3; }
h4 { font-size: $h4; }
h5 { font-size: $h5; }
p {
font-family: $base-font, $base-font-family;
margin: 0; margin: 0;
margin-bottom: 1em; margin-bottom: 1em;
line-height: $base-line-height;
} }
a {
text-decoration: none;
color: $primary-color;
}
p > code {
color: $red;
border: 1px solid rgba(38,50,56,0.1);
}
strong {
font-size: 18px;
color: $headers-color;
}
footer {
text-align: right;
padding: 10px;
font-size: 15px;
}
}
/* markdown elements */ /* markdown elements */
:host .redoc-markdown-block { :host .redoc-markdown-block {
@ -110,10 +152,10 @@ api-logo {
code { code {
font-family: Courier, monospace; font-family: Courier, monospace;
background-color: rgba(0,0,0,0.04); background-color: rgba(38,50,56,0.04);
padding: 0.2em 0; padding: 0.1em 0 0.2em 0;
font-size: 1em; font-size: 1em;
border-radius: 3px; border-radius: $border-radius;
&:before, &:after { &:before, &:after {
letter-spacing: -0.2em; letter-spacing: -0.2em;

View File

@ -2,7 +2,7 @@
header { header {
font-family: $headers-font; font-family: $headers-font;
font-size: .9em; font-size: $h5;
text-transform: uppercase; text-transform: uppercase;
margin: 0 0 12px 0; margin: 0 0 12px 0;
color: $sample-panel-headers-color; color: $sample-panel-headers-color;

View File

@ -6,7 +6,7 @@
</span> </span>
</div> </div>
<div id="resources-nav"> <div id="resources-nav">
<h2 class="menu-header"> API reference </h2> <h5 class="menu-header"> API reference </h5>
<div *ngFor="var cat of data.menu; #idx = index" class="menu-cat"> <div *ngFor="var cat of data.menu; #idx = index" class="menu-cat">
<label class="menu-cat-header" (click)="activateAndScroll(idx, -1)" [ngClass]="{active: cat.active}"> {{cat.name}}</label> <label class="menu-cat-header" (click)="activateAndScroll(idx, -1)" [ngClass]="{active: cat.active}"> {{cat.name}}</label>

View File

@ -6,69 +6,67 @@ $mobile-menu-compact-breakpoint: 550px;
color: $headers-color; color: $headers-color;
padding: 0 $side-menu-item-hpadding; padding: 0 $side-menu-item-hpadding;
margin: 10px 0; margin: 10px 0;
font-size: 16px;
} }
.menu-cat-header { .menu-cat-header {
font-size: 15px; font-size: $h5;
font-family: $headers-font, $headers-font-family;
font-weight: $light;
cursor: pointer; cursor: pointer;
color: $side-menu-item-color; color: $text-color;
text-transform: uppercase; text-transform: uppercase;
background-color: $side-bar-bg-color; background-color: $side-bar-bg-color;
-webkit-transition: all .15s ease-in-out;
-moz-transition: all .15s ease-in-out;
-ms-transition: all .15s ease-in-out;
-o-transition: all .15s ease-in-out;
transition: all .15s ease-in-out;
display: block; display: block;
padding: $side-menu-item-vpadding $side-menu-item-hpadding; padding: $side-menu-item-vpadding $side-menu-item-hpadding;
}
.menu-cat:nth-of-type(even) .menu-cat-header { &:hover,
background-color: $side-menu-even-bg-color; &.active {
color: $primary-color;
background-color: $side-menu-active-bg-color;
} }
.menu-cat .menu-cat-header.active {
background-color: darken($side-menu-active-bg-color, 5%);
} }
.menu-subitems { .menu-subitems {
margin: 0; margin: 0;
font-size: 13px;
font-weight: $regular;
color: rgba($text-color, .6);
padding: 0; padding: 0;
height: 0; height: 0;
overflow: hidden; overflow: hidden;
}
.menu-subitems.active { &.active {
height: auto; height: auto;
} }
.menu-subitems li { & li {
-webkit-transition: all .15s ease-in-out;
-moz-transition: all .15s ease-in-out;
-ms-transition: all .15s ease-in-out;
-o-transition: all .15s ease-in-out;
transition: all .15s ease-in-out;
list-style: none inside none; list-style: none inside none;
cursor: pointer; cursor: pointer;
background-color: $side-menu-active-bg-color;
padding: $side-menu-item-vpadding $side-menu-item-hpadding; padding: $side-menu-item-vpadding $side-menu-item-hpadding;
padding-left: $side-menu-item-hpadding*2; padding-left: $side-menu-item-hpadding*2;
background-color: $side-bar-bg-color;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.menu-subitems li:nth-of-type(even) { & li:hover,
background-color: $side-menu-even-bg-color; & li.active {
} background: darken($side-menu-active-bg-color, 6%);
// invert item colors for odd categories
.menu-cat:nth-of-type(odd) {
.menu-subitems li {
background-color: $side-menu-even-bg-color;
}
.menu-subitems li:nth-of-type(even) {
background-color: $side-bar-bg-color;
} }
} }
.menu-cat .menu-subitems {
li.active, li.active:nth-of-type(even) { .menu-subitems li.active {
background-color: $side-menu-active-bg-color;
}
} }
.mobile-nav { .mobile-nav {