feat: markcss
This commit is contained in:
parent
dd696ba663
commit
1e6e0a61b3
2 changed files with 5 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ import {
|
||||||
lineNumbers,
|
lineNumbers,
|
||||||
drawSelection,
|
drawSelection,
|
||||||
} from '@codemirror/view';
|
} from '@codemirror/view';
|
||||||
import { Pattern, repl } from '@strudel/core';
|
import { repl, registerControl } from '@strudel/core';
|
||||||
import { Drawer, cleanupDraw } from '@strudel/draw';
|
import { Drawer, cleanupDraw } from '@strudel/draw';
|
||||||
import { isAutoCompletionEnabled } from './autocomplete.mjs';
|
import { isAutoCompletionEnabled } from './autocomplete.mjs';
|
||||||
import { isTooltipEnabled } from './tooltip.mjs';
|
import { isTooltipEnabled } from './tooltip.mjs';
|
||||||
|
|
@ -354,3 +354,5 @@ function s4() {
|
||||||
.toString(16)
|
.toString(16)
|
||||||
.substring(1);
|
.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const markcss = registerControl('markcss');
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ const miniLocationHighlights = EditorView.decorations.compute([miniLocations, vi
|
||||||
if (haps.has(id)) {
|
if (haps.has(id)) {
|
||||||
const hap = haps.get(id);
|
const hap = haps.get(id);
|
||||||
const color = hap.value?.color ?? 'var(--foreground)';
|
const color = hap.value?.color ?? 'var(--foreground)';
|
||||||
|
const style = hap.value?.markcss || `outline: solid 2px ${color}`;
|
||||||
// Get explicit channels for color values
|
// Get explicit channels for color values
|
||||||
/*
|
/*
|
||||||
const swatch = document.createElement('div');
|
const swatch = document.createElement('div');
|
||||||
|
|
@ -114,7 +115,7 @@ const miniLocationHighlights = EditorView.decorations.compute([miniLocations, vi
|
||||||
to,
|
to,
|
||||||
Decoration.mark({
|
Decoration.mark({
|
||||||
// attributes: { style: `outline: solid 2px rgba(${channels.join(', ')})` },
|
// attributes: { style: `outline: solid 2px rgba(${channels.join(', ')})` },
|
||||||
attributes: { style: `outline: solid 2px ${color}` },
|
attributes: { style },
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue