1.0.6 • Published 6 years ago

rainbow-decorator v1.0.6

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
6 years ago

Rainbow Decorator

Indent-Rainbow ported to work with Monaco

example

Usage

import rainbowDecorate from "rainbow-decorators";

const editor = monaco.editor.create(document.getElementById("container"), {
	value: "function hello() {\n\talert('Hello world!');\n}",
	language: "javascript"
});

rainbowDecorate(editor);

Rainbow decorator will attach itself to the editor and respond to any changes in content. When the editor is disposed the rainbow will also clear itself.

Configuration

An optional config can be passed in after the editor to

optiontypedefaultnotes
debouncenumber200Time in milliseconds to debounce applying decorators
coloursstring[]"rgba(64,64,16,0.3)","rgba(32,64,32,0.3)","rgba(64,32,64,0.3)","rgba(16,48,48,0.3)"An array of valid CSS colours
classNamesstring[]An array classNames, only aplpied if no colours was provided
errorColourstringrgba(128,32,32,0.3)Colour used when a line does not have correct indentation
errorClassNamestringclassName to use for invalid lines, only applied if no errorColour was provided
tabSizenumber4Tab size for each stage of indents
skipErrorsbooleanfalseIf true, skips marking incorrectly indented lines with an error
1.0.6

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago