aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor/EditorTheme.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-11-01 12:05:21 -0400
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-11-05 19:41:33 +0100
commitffe5b08149681f51625bdac43c7ab41ccf5f9cc3 (patch)
treef19137f20c73613ed8d4e63a725e4a1d20a00ec2 /subprojects/frontend/src/editor/EditorTheme.ts
parentfeat(frontend): overlay scrollbars for editor (diff)
downloadrefinery-ffe5b08149681f51625bdac43c7ab41ccf5f9cc3.tar.gz
refinery-ffe5b08149681f51625bdac43c7ab41ccf5f9cc3.tar.zst
refinery-ffe5b08149681f51625bdac43c7ab41ccf5f9cc3.zip
feat(frontend): scrollbar annotations
Diffstat (limited to 'subprojects/frontend/src/editor/EditorTheme.ts')
-rw-r--r--subprojects/frontend/src/editor/EditorTheme.ts26
1 files changed, 22 insertions, 4 deletions
diff --git a/subprojects/frontend/src/editor/EditorTheme.ts b/subprojects/frontend/src/editor/EditorTheme.ts
index 829b709f..f5267682 100644
--- a/subprojects/frontend/src/editor/EditorTheme.ts
+++ b/subprojects/frontend/src/editor/EditorTheme.ts
@@ -137,7 +137,7 @@ export default styled('div', {
137 background: 'transparent', 137 background: 'transparent',
138 }, 138 },
139 '.cm-cursor, .cm-cursor-primary': { 139 '.cm-cursor, .cm-cursor-primary': {
140 borderLeft: `2px solid ${theme.palette.primary.main}`, 140 borderLeft: `2px solid ${theme.palette.highlight.cursor}`,
141 }, 141 },
142 '.cm-selectionBackground': { 142 '.cm-selectionBackground': {
143 background: theme.palette.highlight.selection, 143 background: theme.palette.highlight.selection,
@@ -245,6 +245,17 @@ export default styled('div', {
245 boxShadow: `1px 0 0 ${theme.palette.text.primary} inset`, 245 boxShadow: `1px 0 0 ${theme.palette.text.primary} inset`,
246 }, 246 },
247 }, 247 },
248 '.cm-scroller-selection': {
249 position: 'absolute',
250 right: 0,
251 boxShadow: `0 2px 0 ${theme.palette.highlight.cursor} inset`,
252 zIndex: 200,
253 },
254 '.cm-scroller-occurrence': {
255 position: 'absolute',
256 background: theme.palette.text.secondary,
257 zIndex: 150,
258 },
248 }; 259 };
249 260
250 const lineNumberStyle: CSSObject = { 261 const lineNumberStyle: CSSObject = {
@@ -288,6 +299,7 @@ export default styled('div', {
288 function lintSeverityStyle( 299 function lintSeverityStyle(
289 severity: 'error' | 'warning' | 'info', 300 severity: 'error' | 'warning' | 'info',
290 icon: string, 301 icon: string,
302 zIndex: number,
291 ): CSSObject { 303 ): CSSObject {
292 const palette = theme.palette[severity]; 304 const palette = theme.palette[severity];
293 const color = palette.main; 305 const color = palette.main;
@@ -342,6 +354,12 @@ export default styled('div', {
342 display: 'none', 354 display: 'none',
343 }, 355 },
344 }, 356 },
357 [`.cm-scroller-diagnostic-${severity}`]: {
358 position: 'absolute',
359 right: 0,
360 background: color,
361 zIndex,
362 },
345 }; 363 };
346 } 364 }
347 365
@@ -400,9 +418,9 @@ export default styled('div', {
400 '.cm-lintRange-active': { 418 '.cm-lintRange-active': {
401 background: theme.palette.highlight.activeLintRange, 419 background: theme.palette.highlight.activeLintRange,
402 }, 420 },
403 ...lintSeverityStyle('error', errorSVG), 421 ...lintSeverityStyle('error', errorSVG, 120),
404 ...lintSeverityStyle('warning', warningSVG), 422 ...lintSeverityStyle('warning', warningSVG, 110),
405 ...lintSeverityStyle('info', infoSVG), 423 ...lintSeverityStyle('info', infoSVG, 100),
406 }; 424 };
407 425
408 const foldStyle = { 426 const foldStyle = {