2013-05-15 16:32:28 +00:00
|
|
|
title: $:/plugins/tiddlywiki/codemirror/styles
|
2014-09-10 08:13:21 +00:00
|
|
|
tags: [[$:/tags/Stylesheet]]
|
2020-11-28 14:07:12 +00:00
|
|
|
module-type: codemirror-theme
|
|
|
|
name: tiddlywiki
|
2013-05-15 16:32:28 +00:00
|
|
|
|
2020-12-04 19:14:59 +00:00
|
|
|
\define set-fat-cursor-background-css(colour,colourA,colourB)
|
|
|
|
<$set name="backgroundColour" value=<<contrastcolour target:"""$colour$""" fallbackTarget:"""""" colourA:"""$colourA$""" colourB:"""$colourB$""">>>
|
|
|
|
.cm-s-tiddlywiki.cm-fat-cursor .CodeMirror-cursor { background: <<backgroundColour>>; }
|
|
|
|
.cm-s-tiddlywiki .cm-animate-fat-cursor { background-color: <<backgroundColour>>; }
|
|
|
|
</$set>
|
|
|
|
\end
|
|
|
|
\define set-fat-cursor-background-colours(palette)
|
|
|
|
<$macrocall $name="set-fat-cursor-background-css" colour={{$palette$##foreground}} colourA="#77ee77" colourB="#586e75"/>
|
|
|
|
\end
|
|
|
|
\define set-fat-cursor-background()
|
|
|
|
<$macrocall $name="set-fat-cursor-background-colours" palette={{$:/palette}}/>
|
|
|
|
\end
|
2020-12-13 11:40:57 +00:00
|
|
|
\define set-selection-background-css(colour,colourA,colourB,tiddlerEditorBackground)
|
|
|
|
<$wikify name="tiddlerEditorBackground" text={{{ [[$tiddlerEditorBackground$]lowercase[]] }}}>
|
2020-12-05 16:37:50 +00:00
|
|
|
<$set name="backgroundColour" value=<<contrastcolour target:"""$colour$""" fallbackTarget:"""""" colourA:"""$colourA$""" colourB:"""$colourB$""">>>
|
2020-12-13 11:40:57 +00:00
|
|
|
<$set name="backgroundColour" value={{{ [<backgroundColour>lowercase[]match<tiddlerEditorBackground>then[]] ~[<backgroundColour>] }}}>
|
|
|
|
.cm-s-tiddlywiki div.CodeMirror-selected { background: <<backgroundColour>>; color: <<colour foreground>>; }
|
|
|
|
.cm-s-tiddlywiki.CodeMirror ::selection { background: <<backgroundColour>>; color: <<colour foreground>>; }
|
|
|
|
.cm-s-tiddlywiki .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: <<backgroundColour>>; color: <<colour foreground>>; }
|
|
|
|
.cm-s-tiddlywiki .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: <<backgroundColour>>; color: <<colour foreground>>; }
|
2020-12-05 16:37:50 +00:00
|
|
|
</$set>
|
2020-12-13 11:40:57 +00:00
|
|
|
</$set>
|
|
|
|
</$wikify>
|
2020-12-05 16:37:50 +00:00
|
|
|
\end
|
|
|
|
\define set-selection-background-colours(palette)
|
2020-12-13 11:40:57 +00:00
|
|
|
<$macrocall $name="set-selection-background-css" colour={{$palette$##foreground}} colourA={{{ [{$palette$##selection-background}!match[]!prefix[<<]!suffix[>>]] ~#073642 }}} colourB={{{ [{$palette$##selection-background}!match[]!prefix[<<]!suffix[>>]] ~#eee8d5 }}} tiddlerEditorBackground={{$palette$##tiddler-editor-background}}/>
|
2020-12-05 16:37:50 +00:00
|
|
|
\end
|
|
|
|
\define set-selection-background()
|
|
|
|
<$macrocall $name="set-selection-background-colours" palette={{$:/palette}}/>
|
|
|
|
\end
|
2020-12-04 19:14:59 +00:00
|
|
|
|
|
|
|
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock
|
|
|
|
|
2013-05-15 16:32:28 +00:00
|
|
|
/* Make the editor resize to fit its content */
|
|
|
|
|
|
|
|
.CodeMirror {
|
|
|
|
height: auto;
|
2019-03-12 16:41:22 +00:00
|
|
|
border: 1px solid <<colour tiddler-editor-border>>;
|
2013-11-09 15:56:17 +00:00
|
|
|
line-height: 1.5;
|
2018-04-06 16:34:50 +00:00
|
|
|
font-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}};
|
2018-05-19 07:50:18 +00:00
|
|
|
font-size: {{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}};
|
2013-05-15 16:32:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.CodeMirror-scroll {
|
|
|
|
overflow-x: auto;
|
2020-11-28 14:07:12 +00:00
|
|
|
overflow-y: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.cm-s-tiddlywiki {
|
|
|
|
color-profile: sRGB;
|
|
|
|
rendering-intent: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.cm-s-tiddlywiki.CodeMirror, .cm-s-tiddlywiki .CodeMirror-gutters { background-color: <<colour tiddler-editor-background>>; color: <<colour foreground>>; }
|
2020-12-06 08:56:06 +00:00
|
|
|
.cm-s-tiddlywiki .CodeMirror-gutters {background: <<colour tiddler-editor-background>>; border-right: 1px solid <<colour tiddler-editor-border>>;}
|
2020-12-02 12:21:23 +00:00
|
|
|
.cm-s-tiddlywiki .CodeMirror-linenumber {color: <<colour foreground>>;}
|
2020-11-28 14:07:12 +00:00
|
|
|
.cm-s-tiddlywiki .CodeMirror-cursor { border-left: 2px solid <<colour foreground>>; }
|
2020-12-05 16:37:50 +00:00
|
|
|
.cm-s-tiddlywiki span.cm-comment { color: #586e75; font-style:italic; font-weight:normal; }
|
2020-12-04 19:14:59 +00:00
|
|
|
.cm-s-tiddlywiki .CodeMirror-activeline-background, .cm-s-tiddlywiki .CodeMirror-activeline-gutter .CodeMirror-linenumber { background: rgba(127,127,127,0.2); }
|
|
|
|
.cm-s-tiddlywiki span.cm-matchhighlight { color: <<colour background>>; background-color: <<colour primary>>; font-weight: normal;}
|
2020-12-06 17:21:35 +00:00
|
|
|
.cm-s-tiddlywiki .CodeMirror-widget { text-shadow: none; }
|
|
|
|
.cm-s-tiddlywiki .CodeMirror-dialog { background: <<colour tiddler-background>>; }
|
2020-11-28 14:07:12 +00:00
|
|
|
.cm-s-tiddlywiki .cm-header { color: #586e75; }
|
|
|
|
.cm-s-tiddlywiki .cm-quote { color: #93a1a1; }
|
|
|
|
.cm-s-tiddlywiki .cm-keyword { color: #cb4b16; }
|
|
|
|
.cm-s-tiddlywiki .cm-atom { color: #d33682; }
|
|
|
|
.cm-s-tiddlywiki .cm-number { color: #d33682; }
|
|
|
|
.cm-s-tiddlywiki .cm-def { color: #2aa198; }
|
|
|
|
.cm-s-tiddlywiki .cm-variable { color: #839496; }
|
|
|
|
.cm-s-tiddlywiki .cm-variable-2 { color: #b58900; }
|
|
|
|
.cm-s-tiddlywiki .cm-variable-3, .cm-s-tiddlywiki .cm-type { color: #6c71c4; }
|
|
|
|
.cm-s-tiddlywiki .cm-property { color: #2aa198; }
|
|
|
|
.cm-s-tiddlywiki .cm-operator { color: #6c71c4; }
|
|
|
|
.cm-s-tiddlywiki .cm-comment { color: #586e75; font-style:italic; }
|
|
|
|
.cm-s-tiddlywiki .cm-string { color: #859900; }
|
|
|
|
.cm-s-tiddlywiki .cm-string-2 { color: #b58900; }
|
|
|
|
.cm-s-tiddlywiki .cm-meta { color: #859900; }
|
|
|
|
.cm-s-tiddlywiki .cm-qualifier { color: #b58900; }
|
|
|
|
.cm-s-tiddlywiki .cm-builtin { color: #d33682; }
|
|
|
|
.cm-s-tiddlywiki .cm-bracket { color: #cb4b16; }
|
|
|
|
.cm-s-tiddlywiki .CodeMirror-matchingbracket { color: #859900; }
|
|
|
|
.cm-s-tiddlywiki .CodeMirror-nonmatchingbracket { color: #dc322f; }
|
|
|
|
.cm-s-tiddlywiki .cm-tag { color: #93a1a1; }
|
|
|
|
.cm-s-tiddlywiki .cm-attribute { color: #2aa198; }
|
2020-12-06 17:21:35 +00:00
|
|
|
.cm-s-tiddlywiki .cm-hr { color: transparent; border-top: 1px solid #586e75; display: block; }
|
2020-11-28 14:07:12 +00:00
|
|
|
.cm-s-tiddlywiki .cm-link { color: #93a1a1; cursor: pointer; }
|
|
|
|
.cm-s-tiddlywiki .cm-special { color: #6c71c4; }
|
2020-12-06 17:21:35 +00:00
|
|
|
.cm-s-tiddlywiki .cm-em { color: #999; text-decoration: underline; text-decoration-style: dotted; }
|
2020-11-28 14:07:12 +00:00
|
|
|
.cm-s-tiddlywiki .cm-error,
|
2020-12-06 17:21:35 +00:00
|
|
|
.cm-s-tiddlywiki .cm-invalidchar { color: #586e75; border-bottom: 1px dotted #dc322f; }
|
2020-12-04 19:14:59 +00:00
|
|
|
.cm-s-tiddlywiki .CodeMirror-matchingbracket { color: #859900; }
|
|
|
|
.cm-s-tiddlywiki .CodeMirror-nonmatchingbracket { color: #dc322f; }
|
|
|
|
.cm-s-tiddlywiki .cm-searching { background: rgba(243, 155, 53, .3); outline: 1px solid #F39B35; }
|
|
|
|
<<set-fat-cursor-background>>
|
2020-12-05 16:37:50 +00:00
|
|
|
<<set-selection-background>>
|