api-console-assets
Version:
This repo only exists to publish api console components to npm
561 lines (461 loc) • 11.6 kB
HTML
<!--
@license
Copyright 2016 The Advanced REST client authors <arc@mulesoft.com>
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.
-->
<link rel="import" href="../polymer/polymer.html">
<!--
Styles definition for Advanced REST Client and API Console for CodeMirror
editor.
## Usage
Install in the project:
```bash
$ bower install --save advanced-rest-client/code-mirror-styles
```
Include dependency
```html
<link rel="import" href="../code-mirror-styles/cm-arc-styles.html">
```
Use in the code:
```html
<code-mirror opened theme="cm-arc"></code-mirror>
```
Note: Do not include it to page styles. This will not work due to scoping in
shaggy DOM.
@group UI Elements
@element cm-arc
-->
<dom-module id="cm-arc">
<template>
<style>
/* BASICS */
.CodeMirror.cm-s-cm-arc {
font-family: var(--code-mirror-font-family, monospace);
font-size: var(--code-mirror-font-size, 15px);
height: var(--code-mirror-height, inherit);
min-height: var(--code-mirror-minimum-height, 60px);
padding: var(--code-mirror-padding, 8px);
color: var(--code-mirror-color, #757575);
background-color: var(--code-mirror-background-color, #fff);
cursor: text;
@apply(--code-mirror-editor);
}
.CodeMirror.cm-s-cm-arc.parsed-content {
white-space: pre-line;
}
/* Vertical padding around content */
.cm-s-cm-arc .CodeMirror-lines {
padding: 4px 0;
@apply(--code-mirror-editor-lines);
}
/* Horizontal padding of content */
.CodeMirror.cm-s-cm-arc pre {
padding: 0 4px;
@apply(--code-mirror-editor-pre-element);
}
/* The little square between H and V scrollbars */
.cm-s-cm-arc .CodeMirror-scrollbar-filler,
.cm-s-cm-arc .CodeMirror-gutter-filler {
background-color: white;
}
/* GUTTER */
.cm-s-cm-arc .CodeMirror-gutters {
border-right: 1px solid #ddd;
background-color: #f7f7f7;
white-space: nowrap;
}
.cm-s-cm-arc .CodeMirror-linenumbers {}
.cm-s-cm-arc .CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.cm-s-cm-arc .CodeMirror-guttermarker {
color: black;
}
.cm-s-cm-arc .CodeMirror-guttermarker-subtle {
color: #999;
}
/* CURSOR */
.CodeMirror.cm-s-cm-arc div.CodeMirror-cursor {
border-left: 1px solid black;
}
/* Shown when moving in bi-directional text */
.CodeMirror.cm-s-cm-arc div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
@-webkit-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
/* Can style cursor different in overwrite (non-insert) mode */
div.CodeMirror-overwrite div.CodeMirror-cursor {}
.cm-tab {
display: inline-block;
text-decoration: inherit;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-cm-arc .cm-keyword {
color: #708;
}
.cm-s-cm-arc .cm-atom {
color: #B71C1C;
@apply --code-mirror-atom;
}
.cm-s-cm-arc .cm-number {
color: #164;
@apply --code-mirror-number;
}
.cm-s-cm-arc .cm-def {
color: #00f;
}
.cm-s-cm-arc .cm-variable,
.cm-s-cm-arc .cm-punctuation,
.cm-s-cm-arc .cm-property,
.cm-s-cm-arc .cm-operator {}
.cm-s-cm-arc .cm-string.cm-property {
color: #43A047;
}
.cm-s-cm-arc .cm-variable-2 {
color: #05a;
}
.cm-s-cm-arc .cm-variable-3 {
color: #085;
}
.cm-s-cm-arc .cm-comment {
color: #a50;
}
.cm-s-cm-arc .cm-string {
color: #009688;
@apply --code-mirror-string;
}
.cm-s-cm-arc .cm-string-2 {
color: #f50;
}
.cm-s-cm-arc .cm-meta {
color: #555;
}
.cm-s-cm-arc .cm-qualifier {
color: #555;
}
.cm-s-cm-arc .cm-builtin {
color: #30a;
}
.cm-s-cm-arc .cm-bracket {
color: #997;
}
.cm-s-cm-arc .cm-tag {
color: #170;
}
.cm-s-cm-arc .cm-attribute {
color: #00c;
}
.cm-s-cm-arc .cm-header {
color: blue;
}
.cm-s-cm-arc .cm-quote {
color: #090;
}
.cm-s-cm-arc .cm-hr {
color: #999;
}
.cm-s-cm-arc .cm-link {
color: #00c;
}
.cm-negative {
color: #d44;
}
.cm-positive {
color: #292;
}
.cm-header,
.cm-strong {
font-weight: bold;
}
.cm-em {
font-style: italic;
}
.cm-link {
text-decoration: underline;
}
.cm-strikethrough {
text-decoration: line-through;
}
.cm-s-cm-arc .cm-error {
color: #f00;
}
.cm-invalidchar {
color: #f00;
}
.CodeMirror-composing {
border-bottom: 2px solid;
}
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {
color: #0f0;
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
color: #f22;
}
.CodeMirror-matchingtag {
background: rgba(255, 150, 0, .3);
}
.CodeMirror-activeline-background {
background: #e8f2ff;
}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
background: white;
}
.cm-s-cm-arc .CodeMirror-scroll {
overflow: auto ;
/* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px;
margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none;
/* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar,
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0;
top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0;
left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0;
bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0;
bottom: 0;
}
.CodeMirror-gutters {
position: absolute;
left: 0;
top: 0;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
margin-bottom: -30px;
/* Hack to make IE7 behave */
*zoom: 1;
*display: inline;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
height: 100%;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-lines {
cursor: text;
min-height: 1px;
/* prevents collapsing before first draw */
;
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-widget {}
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre {
position: static;
}
.CodeMirror div.CodeMirror-cursor {
position: absolute;
border-right: none;
width: 0;
}
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected {
background: #d9d9d9;
}
.CodeMirror-focused .CodeMirror-selected {
background: #d7d4f0;
}
.CodeMirror-crosshair {
cursor: crosshair;
}
.CodeMirror ::selection {
background: #d7d4f0;
}
.CodeMirror ::-moz-selection {
background: #d7d4f0;
}
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span {
*vertical-align: text-bottom;
}
/* Used to force a border model for a node */
.cm-force-border {
padding-right: 0.1px;
}
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after {
content: '';
}
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext {
background: none;
}
</style>
</template>
</dom-module>