2e62c6b288
* Styles CodeMirror Search box * Switch to fork of search add-on * Styles search box using custom markup * Prev/Next search behaviour, highlighting current result * Hide search modifiers until implemented * Regexp search * Style RegExp modifier button active state * Styles search modifiers * Wires up Case Sensitive search button * Allows case insenstive regexp search * Do not show underlying regexp query string when re-opening dialog * Adds "Whole word" search * Adds title and aria-label for tooltip and screenreaders * Whole Word button shows correct active/inactive state * Disables replace implementation which doesn't work * Tidies up query parsing so it's less of a hack - uses state to convert query text into a regexp - avoids having to fake regexp using "/.../" syntax - parsing is now in one place * Uses shared metaKey function for Cmd/Ctrl key * Adds find function to keyboard shortcuts modals * Sets aria-checked to true/false to indicate button state * Sets role=checkbox on checkbox-like buttons
298 lines
5.8 KiB
SCSS
298 lines
5.8 KiB
SCSS
.CodeMirror {
|
|
@include themify() {
|
|
border: 1px solid getThemifyVariable('ide-border-color');
|
|
}
|
|
font-family: Inconsolata, monospace;
|
|
height: 100%;
|
|
}
|
|
|
|
.CodeMirror-linenumbers {
|
|
padding-right: #{10 / $base-font-size}rem;
|
|
|
|
}
|
|
|
|
.CodeMirror-linenumber {
|
|
width: #{32 / $base-font-size}rem;
|
|
left: 0 !important;
|
|
@include themify() {
|
|
color: getThemifyVariable('inactive-text-color');
|
|
}
|
|
}
|
|
|
|
.CodeMirror-lines {
|
|
padding-top: #{25 / $base-font-size}rem;
|
|
}
|
|
|
|
.CodeMirror-line {
|
|
padding-left: #{5 / $base-font-size}rem;
|
|
}
|
|
|
|
.CodeMirror-gutter-wrapper {
|
|
right: 100%;
|
|
top: 0;
|
|
bottom: 0;
|
|
}
|
|
|
|
.CodeMirror-lint-marker-warning, .CodeMirror-lint-marker-error, .CodeMirror-lint-marker-multiple {
|
|
background-image: none;
|
|
width: #{48 / $base-font-size}rem;
|
|
position: absolute;
|
|
height: 100%;
|
|
}
|
|
|
|
.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
|
|
background-image: none;
|
|
padding-left: inherit;
|
|
}
|
|
|
|
.CodeMirror-lint-marker-warning {
|
|
background-color: rgb(255, 190, 5);
|
|
}
|
|
|
|
.CodeMirror-lint-marker-error {
|
|
background-color: rgb(255, 95, 82);
|
|
}
|
|
|
|
.CodeMirror-gutter-elt:not(.CodeMirror-linenumber) {
|
|
opacity: 0.3;
|
|
width: #{48 / $base-font-size}rem !important;
|
|
height: 100%;
|
|
// background-color: rgb(255, 95, 82);
|
|
}
|
|
|
|
.CodeMirror-lint-tooltip {
|
|
@include themify() {
|
|
background-color: getThemifyVariable('modal-background-color');
|
|
border: 1px solid getThemifyVariable('modal-border-color');
|
|
box-shadow: 0 12px 12px getThemifyVariable('shadow-color');
|
|
color: getThemifyVariable('primary-text-color');
|
|
}
|
|
border-radius: 2px;
|
|
font-family: Montserrat, sans-serif;
|
|
}
|
|
|
|
.CodeMirror-gutters {
|
|
@include themify() {
|
|
background-color: getThemifyVariable('editor-gutter-color');
|
|
border-color: getThemifyVariable('ide-border-color');
|
|
}
|
|
// left: 0 !important;
|
|
width: #{48 / $base-font-size}rem;
|
|
}
|
|
|
|
/*
|
|
Search dialog
|
|
*/
|
|
|
|
.CodeMirror-dialog {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
|
|
z-index: 10;
|
|
|
|
min-width: 365px;
|
|
|
|
font-family: Montserrat, sans-serif;
|
|
|
|
padding: #{14 / $base-font-size}rem #{20 / $base-font-size}rem #{14 / $base-font-size}rem #{18 / $base-font-size}rem;
|
|
|
|
border-radius: 2px;
|
|
|
|
@include themify() {
|
|
background-color: getThemifyVariable('modal-background-color');
|
|
box-shadow: 0 12px 12px 0 getThemifyVariable('shadow-color');
|
|
border: solid 0.5px getThemifyVariable('modal-border-color');
|
|
}
|
|
}
|
|
|
|
.CodeMirror-search-title {
|
|
display: block;
|
|
margin-bottom: #{12 / $base-font-size}rem;
|
|
|
|
font-size: #{21 / $base-font-size}rem;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.CodeMirror-search-field {
|
|
display: block;
|
|
width: 100%;
|
|
margin-bottom: #{12 / $base-font-size}rem;
|
|
}
|
|
|
|
.CodeMirror-search-count {
|
|
display: block;
|
|
height: #{20 / $base-font-size}rem;
|
|
text-align: right;
|
|
}
|
|
|
|
.CodeMirror-search-actions {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
/*
|
|
|
|
*/
|
|
.CodeMirror-search-modifiers {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.CodeMirror-regexp-button,
|
|
.CodeMirror-case-button,
|
|
.CodeMirror-word-button {
|
|
width: 20px;
|
|
height: 20px;
|
|
|
|
margin-left: #{10 / $base-font-size}rem;
|
|
|
|
word-break: keep-all;
|
|
white-space: nowrap;
|
|
|
|
@include themify() {
|
|
color: getThemifyVariable('inactive-text-color');
|
|
}
|
|
}
|
|
|
|
.CodeMirror-regexp-button .label,
|
|
.CodeMirror-case-button .label,
|
|
.CodeMirror-word-button .label {
|
|
@extend %hidden-element;
|
|
}
|
|
|
|
[aria-checked="true"] {
|
|
@include themify() {
|
|
color: getThemifyVariable('primary-text-color');
|
|
}
|
|
}
|
|
|
|
/*
|
|
Previous / Next buttons
|
|
*/
|
|
|
|
// Visually hide button text
|
|
.CodeMirror-search-button .label {
|
|
@extend %hidden-element;
|
|
}
|
|
|
|
.CodeMirror-search-button {
|
|
margin-right: #{10 / $base-font-size}rem;
|
|
}
|
|
|
|
.CodeMirror-search-button::after {
|
|
display: block;
|
|
content: ' ';
|
|
|
|
width: 14px;
|
|
height: 14px;
|
|
|
|
@include themify() {
|
|
@extend %icon;
|
|
}
|
|
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
}
|
|
|
|
// Previous button
|
|
.CodeMirror-search-button.prev::after {
|
|
background-image: url(../images/up-arrow.svg)
|
|
}
|
|
|
|
// Next button
|
|
.CodeMirror-search-button.next::after {
|
|
background-image: url(../images/down-arrow.svg)
|
|
}
|
|
|
|
/*
|
|
Close button
|
|
*/
|
|
.CodeMirror-close-button {
|
|
position: absolute;
|
|
top: #{14 / $base-font-size}rem;
|
|
right: #{18 / $base-font-size}rem;
|
|
|
|
display: flex;
|
|
flex-direction: row;
|
|
}
|
|
|
|
// Visually hide button text
|
|
.CodeMirror-close-button .label {
|
|
@extend %hidden-element;
|
|
}
|
|
|
|
.CodeMirror-close-button:after {
|
|
display: block;
|
|
content: ' ';
|
|
|
|
width: 16px;
|
|
height: 16px;
|
|
|
|
margin-left: #{8 / $base-font-size}rem;
|
|
|
|
@include themify() {
|
|
@extend %icon;
|
|
}
|
|
|
|
background: transparent url(../images/exit.svg) no-repeat;
|
|
}
|
|
|
|
.editor-holder {
|
|
height: calc(100% - #{29 / $base-font-size}rem);
|
|
width: 100%;
|
|
position: absolute;
|
|
}
|
|
|
|
.editor__header {
|
|
height: #{29 / $base-font-size}rem;
|
|
}
|
|
|
|
.editor__options-button {
|
|
@include themify() {
|
|
@extend %icon;
|
|
}
|
|
position: absolute;
|
|
top: #{10 / $base-font-size}rem;
|
|
right: #{2 / $base-font-size}rem;
|
|
z-index: 1;
|
|
}
|
|
|
|
|
|
.editor__options {
|
|
display: none;
|
|
@extend %modal;
|
|
position: absolute;
|
|
right: #{0 / $base-font-size}rem;
|
|
padding: #{8 / $base-font-size}rem #{20 / $base-font-size}rem;
|
|
font-size: #{12 / $base-font-size}rem;
|
|
@include themify() {
|
|
background-color: getThemifyVariable('modal-background-color');
|
|
box-shadow: 0 0 18px getThemifyVariable('shadow-color');
|
|
}
|
|
.editor--options & {
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
.editor__options li {
|
|
padding: #{4 / $base-font-size}rem 0;
|
|
}
|
|
|
|
.editor__options a {
|
|
@include themify() {
|
|
color: getThemifyVariable('secondary-text-color');
|
|
}
|
|
}
|
|
|
|
.editor__file-name {
|
|
@include themify() {
|
|
color: getThemifyVariable('secondary-text-color');
|
|
}
|
|
height: #{29 / $base-font-size}rem;
|
|
padding-top: #{7 / $base-font-size}rem;
|
|
padding-left: #{56 / $base-font-size}rem;
|
|
font-size: #{12 / $base-font-size}rem;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|