Skip to content

Commit df61bda

Browse files
add back styles for editor search (#2599)
1 parent 5fb9680 commit df61bda

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

packages/graphiql-react/src/editor/style/codemirror.css

+52
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,55 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
124124
.CodeMirror-focused .CodeMirror-selected {
125125
background: var(--color-neutral-15);
126126
}
127+
128+
/* Position the search dialog */
129+
.CodeMirror-dialog {
130+
background: inherit;
131+
color: inherit;
132+
left: 0;
133+
right: 0;
134+
overflow: hidden;
135+
padding: var(--px-2) var(--px-6);
136+
position: absolute;
137+
z-index: 6;
138+
}
139+
.CodeMirror-dialog-top {
140+
border-bottom: 1px solid var(--color-neutral-15);
141+
padding-bottom: var(--px-12);
142+
top: 0;
143+
}
144+
.CodeMirror-dialog-bottom {
145+
border-top: 1px solid var(--color-neutral-15);
146+
bottom: 0;
147+
padding-top: var(--px-12);
148+
}
149+
150+
/* Hide the search hint */
151+
.CodeMirror-search-hint {
152+
display: none;
153+
}
154+
155+
/* Style the input field for searching */
156+
.CodeMirror-dialog input {
157+
border: 1px solid var(--color-neutral-15);
158+
border-radius: var(--border-radius-4);
159+
padding: var(--px-4);
160+
}
161+
.CodeMirror-dialog input:focus {
162+
outline: var(--color-pink) solid 2px;
163+
}
164+
165+
/* Set the highlight color for search results */
166+
.cm-searching {
167+
background-color: var(--color-orche-background);
168+
/**
169+
* When cycling through search results, CodeMirror overlays the current
170+
* selection with another element that has the .CodeMirror-selected class
171+
* applied. This adds another background color (see above), but this extra
172+
* box does not quite match the height of this element. To match them up we
173+
* add some extra padding here. (Note that this doesn't affect the line
174+
* height of the CodeMirror editor as all line wrappers have a fixed height.)
175+
*/
176+
padding-bottom: 1.5px;
177+
padding-top: 0.5px;
178+
}

0 commit comments

Comments
 (0)