insomnia/app/ui/css/components/editor.less
Gregory Schier 873a59cdbc Clickable codemirror links (#81)
* Multiple recursive rendering

* Click links in respnose view
2017-02-07 16:31:48 -08:00

264 lines
4.6 KiB
Plaintext

@import '../constants/colors';
@import '../constants/dimensions';
@import '../constants/fonts';
.editor {
box-sizing: border-box;
height: 100% !important;
width: 100%;
display: grid;
grid-template-rows: minmax(0, 1fr) auto;
grid-template-columns: 100%;
.editor__container {
height: 100%;
width: 100%;
position: relative;
}
.CodeMirror {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.editor__toolbar {
display: flex;
flex-direction: row;
align-items: center;
border-top: 1px solid @hl-md;
height: @line-height-xs;
input {
font-family: @font-monospace;
margin-right: 0;
width: 100%;
margin-left: @padding-md;
}
button {
color: @hl;
padding: @padding-xs @padding-md;
height: 100%;
}
}
.CodeMirror {
height: 100% !important;
width: 100%;
box-sizing: border-box;
padding-top: @padding-sm;
}
.CodeMirror * {
font-family: @font-monospace;
}
.CodeMirror,
.cm-s-seti.CodeMirror, // Hack because seti theme is dumb
.CodeMirror-gutters,
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
// Let the background behind show through
background-color: transparent !important;
border: 0;
}
.CodeMirror-linenumber, .CodeMirror-guttermarker-subtle {
color: @hl-xl !important;
}
.CodeMirror-gutter {
background-color: var(--color-bg);
}
.CodeMirror-scroll {
cursor: text; // Show text cursor everywhere (not just in .Codemirror-lines)
}
.CodeMirror-lines {
// Scroll past the end
padding-bottom: 30px;
}
.CodeMirror-placeholder {
color: @hl-xl;
}
.CodeMirror-lint-marker-error {
width: 100%;
height: 1em;
display: flex;
background: none;
text-align: center;
&::after {
color: var(--color-danger);
text-align: center;
width: 100%;
font-size: 0.7em; // because the circle is so large
content: '⬤';
}
}
&.editor--readonly .CodeMirror-cursors,
&.editor--readonly .CodeMirror-activeline-background {
opacity: 0;
}
}
// Search dialog (and others)
.CodeMirror-dialog {
background: var(--color-bg);
color: var(--color-font);
border-color: @hl-md;
box-sizing: border-box;
width: 100%;
padding: @padding-sm 0 @padding-sm @padding-sm;
}
// Tooltip for errors
.CodeMirror-lint-tooltip {
background-color: var(--color-bg);
color: var(--color-font);
border-color: @hl-md;
border-radius: 0;
font-size: @font-size-md;
padding: @padding-xs @padding-sm;
z-index: 99999;
.CodeMirror-lint-message-error {
background-image: none;
padding-left: 0;
}
&::after {
display: none;
}
}
/* Based on Sublime Text's Monokai theme */
.CodeMirror {
color: var(--color-font);
div.CodeMirror-selected {
background: var(--color-font);
border-radius: 2px;
opacity: 0.2;
}
.CodeMirror-gutters {
border-right: 0;
}
.CodeMirror-guttermarker {
color: var(--color-font);
}
.CodeMirror-guttermarker-subtle {
color: @hl-lg;
}
.CodeMirror-linenumber {
color: @hl;
}
.CodeMirror-cursor {
border-left: 1px solid var(--color-font);
}
.cm-animate-fat-cursor,
&.cm-fat-cursor .CodeMirror-cursor {
background-color: rgba(255, 139, 147, 0.5) !important;
border-bottom: 2px solid #d60000 !important;
box-sizing: border-box;
}
span.cm-comment,
span.cm-meta,
span.cm-qualifier {
color: var(--color-font);
}
span.cm-atom {
color: var(--color-surprise);
}
span.cm-number {
color: var(--color-surprise);
}
span.cm-keyword {
color: var(--color-danger);
}
span.cm-builtin {
color: var(--color-info);
}
span.cm-string {
color: var(--color-notice);
}
span.cm-property, span.cm-attribute {
color: var(--color-success);
}
span.cm-variable {
color: var(--color-font);
}
span.cm-variable-2 {
color: var(--color-info);
}
span.cm-variable-3 {
color: var(--color-info);
}
span.cm-def {
color: var(--color-warning);
}
span.cm-bracket {
color: var(--color-font);
}
span.cm-tag {
color: var(--color-danger);
}
span.cm-header {
color: var(--color-surprise);
}
span.cm-link {
color: var(--color-surprise);
}
span.cm-error {
background: var(--color-danger);
color: var(--color-font-danger);
}
span.cm-clickable {
text-decoration: underline;
cursor: pointer;
}
span.cm-clickable:hover {
text-decoration: underline;
}
.CodeMirror-activeline-background {
background: @hl-md;
}
.CodeMirror-matchingbracket {
text-decoration: underline;
color: inherit !important;
}
}