Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Envoy theme for Redoc #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,15 @@
<title>ReDoc</title>
<link rel="stylesheet" href="main.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.vaadin.com/vaadin-core-elements/1.2.0/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="https://cdn.vaadin.com/vaadin-core-elements/1.2.0/vaadin-combo-box/vaadin-combo-box-light.html">
<link rel="stylesheet" href="https://unpkg.com/[email protected].0/css/envoy.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<nav>
<header> <a href="/ReDoc"> ReDoc </a> </header>
<template is="dom-bind" id="specs">
<form id="schema-url-form" is="iron-form">
<vaadin-combo-box-light id="spec-input" items="[[specs]]" allow-custom-value>
<input placeholder="URL to a spec to try" id="schema-url-input" type="text" is="iron-input" value="https://rebilly.github.io/RebillyAPI/swagger.json">
</vaadin-combo-box-light>
<button type="submit"> Explore </button>
</form>
</template>
<iframe src="https://ghbtns.com/github-btn.html?user=Rebilly&repo=ReDoc&type=star&count=true&size=large"
frameborder="0" scrolling="0" width="150px" height="30px"></iframe>
</nav>

<redoc scroll-y-offset="body > nav" spec-url='swagger.yaml' lazy-rendering untrusted-spec></redoc>

<script>
window.__REDOC_DEV__ = true;
</script>
<script src="main.js"> </script>
<script src="/webpack-dev-server.js"></script>
<script src="/polyfills.js"></script>
<script src="/redoc.js"></script>
Expand Down
132 changes: 1 addition & 131 deletions demo/main.css
Original file line number Diff line number Diff line change
@@ -1,133 +1,3 @@
body {
margin: 0;
padding-top: 50px;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-moz-tap-highlight-color: rgba(0,0,0,0);
-ms-tap-highlight-color: rgba(0,0,0,0);
-o-tap-highlight-color: rgba(0,0,0,0);
tap-highlight-color: rgba(0,0,0,0);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-smoothing: antialiased;
-webkit-osx-font-smoothing: grayscale;
-moz-osx-font-smoothing: grayscale;
osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
text-size-adjust: 100%;
-webkit-text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
-ms-text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
text-rendering: optimizeSpeed!important;
font-smooth: always;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
text-size-adjust: 100%;
font-family: Monserrat, sans-serif;
}

nav input, nav button {
font-size: 16px;
height: 28px;
box-sizing: border-box;
vertical-align: middle;
line-height: 1;
outline: none;
}
nav header {
font-family: Monserrat, sans-serif;
float: left;
margin-left: 20px;
font-size: 25px;
color: #00329F;
font-weight: bold;
}

nav input {
width: 50%;
box-sizing: border-box;
max-width: 500px;
padding: 0 10px;

color: #555;
background-color: #fff;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}

nav input:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
}

nav button {
background-color: #fff;
color: #333;
padding: 2px 10px;

touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid #ccc;
}

nav button:hover {
background-color: #e6e6e6;
border-color: #adadad;
}
nav button:active {
background-color: #d4d4d4;
border-color: #8c8c8c;
}

nav {
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
background-color: white;
border-bottom: 1px solid #ccc;
position: fixed;
top: 0;
z-index: 1;
box-sizing: border-box;
}

nav iframe {
margin: 10px 0;
position: absolute;
right: 0;
top: 0;
}

header a {
color: inherit;
text-decoration: none;
}
@media (min-width: 1000px) {
nav header {
position: absolute;
}
}

@media (max-width: 500px) {
nav input {
width: 70%;
}
nav header {
display: none;
}

nav iframe {
display: none;
}
}
}
4 changes: 2 additions & 2 deletions lib/components/ParamsList/params-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ $hint-color: #999999;
}

.param-list-header {
border-bottom: 1px solid rgba($text-color, .3);
// border-bottom: 1px solid rgba($text-color, .3);
// padding: 0.2em 0;
margin: 3em 0 1em 0;
color: rgba($text-color, .5);
font-weight: normal;
font-weight: 600;
text-transform: uppercase;
}

Expand Down
3 changes: 1 addition & 2 deletions lib/components/Redoc/redoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ <h1>Oops... ReDoc failed to render this spec</h1>
</div>
<loading-bar *ngIf="options.lazyRendering" [progress]="loadingProgress"> </loading-bar>
<div class="redoc-wrap" *ngIf="specLoaded && !error">
<div class="background">
<div class="background shadow">
<div class="background-actual"> </div>
</div>
<div class="menu-content" sticky-sidebar [disable]="specLoading"
[scrollParent]="options.$scrollParent" [scrollYOffset]="options.scrollYOffset">
<div class="menu-header">
<api-logo> </api-logo>
<redoc-search> </redoc-search>
</div>
<side-menu> </side-menu>
Expand Down
10 changes: 7 additions & 3 deletions lib/components/Redoc/redoc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ side-menu {

.api-content {
margin-left: $side-bar-width;
z-index: 50;
z-index: 100;
position: relative;
// height: 100vh;
// overflow: scroll;
Expand All @@ -80,7 +80,7 @@ side-menu {
bottom: 0;
right: 0;
left: $side-bar-width;
z-index: 1;
z-index: 85;

&-actual {
background: $samples-panel-bg-color;
Expand Down Expand Up @@ -114,6 +114,10 @@ side-menu {

/* global menu items styles (search results + menu) */
:host /deep/ {
mark {
background-color: $yellow;
}

.menu-item-header > span {
display: inline-block;
vertical-align: middle;
Expand Down Expand Up @@ -359,4 +363,4 @@ footer {
text-align: left;
font-weight: bold;
}
}
}
6 changes: 6 additions & 0 deletions lib/components/SchemaSample/schema-sample.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ pre {
border-radius: $border-radius*2;
background-color: darken($black, 2%);
margin-bottom: 36px;
font-family: $mono-font, $mono-font-family;
font-size: $mono-font-size;
line-height: $mono-line-height;
li {
font-family: $mono-font, $mono-font-family;
}
}

ul, .redoc-json ul {
Expand Down
7 changes: 5 additions & 2 deletions lib/components/Search/redoc-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
<li class="result menu-item-header" *ngFor="let item of items"
ngClass="menu-item-depth-{{item.menuItem.depth}} {{item.menuItem.ready ? '' : 'disabled'}}"
(click)="clickSearch(item)">
<span class="operation-type" [ngClass]="item.menuItem?.metadata?.operation" *ngIf="item.menuItem?.metadata?.operation"> {{item.menuItem?.metadata?.operation}} </span><!--
--><span class="menu-item-title">{{item.menuItem.name}}</span>
<span class="menu-item-title">
<i class="fa fa-folder" *ngIf="item.menuItem?.depth == 1"></i>
<i class="fa fa-code" *ngIf="item.menuItem?.metadata?.operation"></i>
{{item.menuItem.name}}
</span>
</li>
</ul>
39 changes: 28 additions & 11 deletions lib/components/Search/redoc-search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
}

.search-input-wrap {
padding: 0 20px;
padding: 0 10px;

> svg {
width: 13px;
height: 27px;
display: inline-block;
position: absolute;
left: 21px;
top: 12px;

path {
fill: lighten($text-color, 20%);
Expand All @@ -25,6 +27,7 @@
width: 13px;
text-align: center;
right: 20px;
top: 12px;
height: 28px;
line-height: 28px;
vertical-align: middle;
Expand All @@ -35,16 +38,17 @@
input {
width: 100%;
box-sizing: border-box;
padding: 5px 20px 5px 20px;
padding: 5px 20px 5px 28px;

border: 0;
border-bottom: 1px solid darken($side-bar-bg-color, 10%);
font-weight: bold;
border: 1px solid darken($side-bar-bg-color, 10%);
font-weight: normal;

font-size: 13px;
font-size: 15px;
color: $text-color;
background-color: transparent;
background-color: #fff;
outline: none;
border-radius: 30px;
}

.search-results {
Expand All @@ -58,24 +62,37 @@ input {
border-top: 1px solid darken($side-bar-bg-color, 10%);
line-height: 1.2;

min-height: 150px;
max-height: 250px;
font-family: $base-font-family;

> li {
display: block;
cursor: pointer;
font-family: Montserrat, sans-serif;
font-family: $base-font-family;
font-weight: 500;
font-size: 13px;
padding: 5px 20px;
padding: 4px 20px;
padding-left: 44px;
position: relative;
i.fa {
position: absolute;
left: 20px;
color: $red;
top: 6px;
}

&:hover {
background-color: darken($side-bar-bg-color, 10%);
}
}

li.menu-item-depth-1 {
color: $primary-color;
text-transform: uppercase;
// color: $primary-color;
// text-transform: uppercase;
}

li.menu-item-depth-2 {
font-size: 0.9em;
}

> li.disabled {
Expand Down
9 changes: 4 additions & 5 deletions lib/components/SideMenu/side-menu-items.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<li *ngFor="let item of items; let idx = index" class="menu-item"
ngClass="menu-item-depth-{{item.depth}} {{item.active ? 'active' : ''}} menu-item-for-{{item.metadata?.type}}">
<label class="menu-item-header" [ngClass]="{disabled: !item.ready, deprecated: item?.metadata?.deprecated}" (click)="activateItem(item)">
<span class="operation-type" [ngClass]="item?.metadata?.operation" *ngIf="item?.metadata?.operation"> {{item?.metadata?.operation}} </span><!--
--><span class="menu-item-title">{{item.name}}</span>
<svg *ngIf="item.items?.length" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 24 24" xml:space="preserve">
<polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "/>
</svg>
<span class="menu-item-title">{{item.name}}</span>
<svg *ngIf="item.items?.length" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 24 24" xml:space="preserve">
<polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "/>
</svg>
</label>
<ul *ngIf="item.items" class="menu-subitems">
<side-menu-items [items]="item.items" (activate)="activateItem($event)"> </side-menu-items>
Expand Down
Loading