
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
rainbowbrackets
Advanced tools

This is a working attempt at a rainbowBracket extension for CodeMirror6.
Great question! Rainbow Brackets are brackets, curly braces, or parentheses that change color with scope/depth. See intelliJ's Rainbow Bracket Extension.

Live Implementation:
Depending on your theme and extensions, the rainbowBrackets may not apply correctly as the span structure looks something like this, where the color of the inner span will override the rainbow-bracket. Investigate with Chrome Dev Tools if you're encountering a bug.
Nearly Fixed as of 2.0.0. See updated API Reference.
<span class="rainbow-bracket-orange">
<span class="ͼ5k">{</span> //opening bracket displaying theme color
</span>
To work around this, we can add the following CSS.
.rainbow-bracket-red > span {
color: red;
}
.rainbow-bracket-orange > span {
color: orange;
}
.rainbow-bracket-yellow > span {
color: yellow;
}
.rainbow-bracket-green > span {
color: green;
}
.rainbow-bracket-blue > span {
color: blue;
}
.rainbow-bracket-indigo > span {
color: indigo;
}
.rainbow-bracket-violet > span {
color: violet;
}
This will override the inner span. Future implementations should ensure the rainbowBracket has higher precedence.
import rainbowBrackets from 'rainbowbrackets'
const cmExtensions = [/*Your Other Extensions */, rainbowBrackets()]
//...
<CodeMirror
//other props
extensions={cmExtensions}
>
coming soon...handle as you would an existing extension
coming soon...handle as you would an existing extension
.rainbow-bracket-red {color: 'red'}
.rainbow-bracket-orange {color: 'orange'}
.rainbow-bracket-yellow {color: 'yellow'}
.rainbow-bracket-green {color: 'green'}
.rainbow-bracket-blue {color: 'blue'}
.rainbow-bracket-indigo {color: 'indigo'}
.rainbow-bracket-violet {color: 'violet'}
.rainbow-bracket-red: { color: 'red' }
.rainbow-bracket-red > span: { color: 'red' }
.rainbow-bracket-orange: { color: 'orange' }
.rainbow-bracket-orange > span: { color: 'orange' }
.rainbow-bracket-yellow: { color: 'yellow' }
.rainbow-bracket-yellow > span: { color: 'yellow' }
.rainbow-bracket-green: { color: 'green' }
.rainbow-bracket-green > span: { color: 'green' }
.rainbow-bracket-blue: { color: 'blue' }
.rainbow-bracket-blue > span: { color: 'blue' }
.rainbow-bracket-indigo: { color: 'indigo' }
.rainbow-bracket-indigo > span: { color: 'indigo' }
.rainbow-bracket-violet: { color: 'violet' }
.rainbow-bracket-violet > span: { color: 'violet' }
git fork, clone, then navigate into this repository.
Install dependencies:
npm install
See Contributing. TLDR: Make a branch with your feature name/bug fix, include detailed commit log and PR message.
Yes! Although it's likely there are unknown bugs I have yet to encounter.
Yes! See the API reference above. If you want to change red to pink, simply use a little CSS:
.rainbow-bracket-red {
color: pink;
}
/* Override may be neccessary as well*/
.rainbow-bracket-red > span {
color: pink;
}
I'll rename these classes if enough people want color flexibility to something more intuitive.
See contributing.md to get started.
Please adhere to this project's code of conduct.
CodeMirror Extensions Forum Discussion
This extension is still experimental and it may not perfectly colorize scope. It still may be useful, or at least fun to use. Improvements are welcome. Big thank you to Marijn Haverbeke, the CodeMirror community, and all its contributors.
FAQs
colorizes brackets, parentheses and braces to help track scope
The npm package rainbowbrackets receives a total of 5,878 weekly downloads. As such, rainbowbrackets popularity was classified as popular.
We found that rainbowbrackets demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.