├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ ├── build-release.yml │ ├── deploy.yml │ └── pr-checks.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .tool-versions ├── .vscode └── launch.json ├── .vscodeignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── code-examples ├── .c ├── .cs ├── .css ├── .go ├── .html ├── .java ├── .js ├── .psm1 ├── .py ├── .sh └── .ts ├── eslint.config.mjs ├── images ├── icon.png ├── icon.svg └── screenshots.jpg ├── package-lock.json ├── package.json ├── release.config.mjs ├── src ├── colors │ ├── base.ts │ ├── extensions │ │ ├── gitlens.ts │ │ └── jupyter-notebook.ts │ └── types.ts ├── main.ts ├── semantic-colors.ts ├── shared.ts └── token-colors │ ├── base.ts │ ├── languages │ ├── c.ts │ ├── css.ts │ ├── cucumber.ts │ ├── golang.ts │ ├── java.ts │ ├── js-ts.ts │ ├── json.ts │ ├── latex.ts │ ├── lisp.ts │ ├── makefile.ts │ ├── mark-up-down.ts │ ├── powershell.ts │ ├── python.ts │ ├── reason-ml.ts │ ├── shell.ts │ └── xml-html.ts │ └── types.ts ├── themes └── .gitignore └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: jdinhify # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: jdinhify # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | thanks_dev: # Replace with a single thanks.dev username 15 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 16 | -------------------------------------------------------------------------------- /.github/workflows/build-release.yml: -------------------------------------------------------------------------------- 1 | name: build & release 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | 7 | jobs: 8 | build-release: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-node@v4 14 | with: 15 | node-version: 22.14.0 16 | - uses: actions/cache@v4 17 | with: 18 | path: | 19 | ~/.npm 20 | key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} 21 | 22 | - run: npm ci 23 | 24 | - run: npm run build 25 | 26 | - name: release 27 | env: 28 | GH_TOKEN: ${{ secrets.GH_TOKEN }} 29 | run: npx semantic-release 30 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: deploy 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | build-deploy: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-node@v4 14 | with: 15 | node-version: 22.14.0 16 | - uses: actions/cache@v4 17 | with: 18 | path: | 19 | ~/.npm 20 | key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} 21 | 22 | - run: npm ci 23 | 24 | - name: publish to vscode marketplace & open-vsx 25 | env: 26 | GH_TOKEN: ${{ secrets.GH_TOKEN }} 27 | VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }} 28 | OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }} 29 | run: | 30 | echo "--- build theme json files" 31 | npm run build 32 | 33 | echo "--- generate changelog.md from github releases" 34 | gh api /repos/{owner}/{repo}/releases --jq '.[] | .body' > changelog.md 35 | 36 | echo "--- publish" 37 | version=$(gh release view --json tagName --jq '.tagName | .[1:]') 38 | echo "version: $version" 39 | git config user.email "14046273+jdinhify@users.noreply.github.com" 40 | git config user.name "jd" 41 | npx vsce publish -p $VSCE_TOKEN --no-git-tag-version $version 42 | npx ovsx publish -p $OVSX_TOKEN --packageVersion $version 43 | -------------------------------------------------------------------------------- /.github/workflows/pr-checks.yml: -------------------------------------------------------------------------------- 1 | name: pr-checks 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | pr-checks: 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: actions/setup-node@v4 13 | with: 14 | node-version: 22.14.0 15 | - uses: actions/cache@v4 16 | with: 17 | path: | 18 | ~/.npm 19 | key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} 20 | 21 | - run: npm ci 22 | 23 | - name: typecheck 24 | run: npm run type:check 25 | - name: lint 26 | run: npm run lint:check 27 | - name: format check 28 | run: npm run format:check 29 | - name: build check 30 | run: npm run build 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Ignore artifacts: 2 | build 3 | coverage 4 | 5 | CHANGELOG.md 6 | .vscode 7 | themes 8 | package.json 9 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true, 3 | "tabWidth": 2 4 | } 5 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | nodejs 22.14.0 2 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Launch Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "internalConsoleOptions": "openOnFirstSessionStart", 10 | "stopOnEntry": false, 11 | "runtimeExecutable": "${execPath}", 12 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | * 2 | src 3 | code-examples 4 | .github 5 | .vscode 6 | node_modules 7 | 8 | !package.json 9 | !LICENSE 10 | !images 11 | !README.md 12 | !changelog.md 13 | !themes 14 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to contribute 2 | 3 | 1. Fork and clone this repo. 4 | 2. Create a branch for your changes. `git switch -c my-new-feature` 5 | 3. Install nodejs, see [.tool-versions](.tool-versions) for the exact version, 6 | 4. Install dependencies. `npm install` 7 | 5. Open the cloned folder in vscode. 8 | 6. Run `npm run dev` to start generating themes 9 | 7. Build and examine your changes in an Extension Development Host. 10 | - Debug > Start Debugging or use F5 as a shortcut 11 | 8. Commit and push your changes. 12 | 9. Submit a PR for discussion, keeping in mind that not all suggestions can be accepted. 13 | 14 | ### Tips 15 | 16 | - VSCode's `Developer: Inspect TM Scopes` command is useful to find out the scope 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2017 JD 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 |
3 | 4 | 5 | 6 |
7 | Gruvbox 8 |
9 |

10 | 11 |

A port of Gruvbox theme to VS Code editor

12 | 13 |

14 | 15 | Version 16 | 17 | 18 | Installs 19 | 20 | 21 | Downloads 22 | 23 | 24 | Ratings 25 | 26 |

27 | 28 | ## About 29 | 30 | A [gruvbox](https://github.com/morhetz/gruvbox) theme including syntax highlighting and workbench & terminal colors. 31 | 32 | ## Installation 33 | 34 | Launch _Quick Open_ 35 | 36 | - Linux `Ctrl+P` 37 | - macOS `⌘P` 38 | - Windows `Ctrl+P` 39 | 40 | Paste the following command and press `Enter`: 41 | 42 | ``` 43 | ext install jdinhlife.gruvbox 44 | ``` 45 | 46 | ## Variants 47 | 48 | - Dark - Medium Contrast 49 | - Dark - Hard Contrast 50 | - Dark - Soft Contrast 51 | - Light - Medium Contrast 52 | - Light - Hard Contrast 53 | - Light - Soft Contrast 54 | 55 | ### Screenshots 56 | 57 | ![screenshots](images/screenshots.jpg) 58 | 59 | ## Credits 60 | 61 | - Special thank to [Pavel Pertsev](https://github.com/morhetz), the creator of [gruvbox](https://github.com/morhetz/gruvbox) original theme. 62 | - A bunch of [awesome contributors](https://github.com/jdinhify/vscode-theme-gruvbox/graphs/contributors) 63 | 64 | ## Contributing 65 | 66 | Please, report issues/bugs and suggestions for improvements to the issue [here](https://github.com/jdinhify/vscode-theme-gruvbox/issues). 67 | 68 | If you'd like to contribute, please follow the [contributing docs](CONTRIBUTING.md) 69 | 70 | ## Release Notes 71 | 72 | See [releases](https://github.com/jdinhify/vscode-theme-gruvbox/releases). 73 | 74 | Copyright (C) 2017 [jd](https://github.com/jdinhify) 75 | -------------------------------------------------------------------------------- /code-examples/.c: -------------------------------------------------------------------------------- 1 | /* Common */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | /* System */ 10 | #include 11 | #include 12 | 13 | /* Net */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | /* Default port if none is specified */ 22 | #define DEFAULT_PORT_ECP 58057 23 | #define DEFAULT_PORT_TES 59000 24 | 25 | 26 | /* 27 | * This program creates a udp server on a given port an waits for incoming requests 28 | * It offers a shell so you can kill the created server 29 | */ 30 | int main(int argc, char** argv) 31 | { 32 | int port, socket_fd, server_pid; 33 | char cmd[10]; 34 | char **parsed_cmd; 35 | 36 | if(argc == 1) 37 | port = DEFAULT_PORT_ECP; 38 | else if(argc == 3 && ((strcmp(argv[1],"-p")) == 0)) 39 | port = atoi(argv[2]); 40 | else{ 41 | printf("ERROR: Wrong input format.\ninput: ./ECP [-p ECPport]\n"); 42 | exit(1); 43 | } 44 | /* Create a UDP server on port */ 45 | server_pid = start_udp_server(port, &socket_fd); 46 | printf("Server PID: %d\n", server_pid); 47 | 48 | printf("Type \"exit\" to terminate server\n"); 49 | while(1){ 50 | printf("> "); 51 | if ((fgets(cmd, 50, stdin)) == NULL){ 52 | perror("[ERROR] no command\n"); 53 | continue; 54 | } 55 | 56 | parsed_cmd = parseString(cmd, "\n"); 57 | 58 | if (strcmp(parsed_cmd[0], "exit") == 0){ 59 | /* To kill the server child process */ 60 | printf("Closing Server...\n"); 61 | close(socket_fd); 62 | if (kill(server_pid, SIGTERM) == -1){ 63 | perror("[ERROR] Killing Server Process"); 64 | free(parsed_cmd); 65 | /* Close server socket */ 66 | exit(-1); 67 | } 68 | /* Exit */ 69 | free(parsed_cmd); 70 | return 0; 71 | } 72 | else 73 | printf("Wrong command \"%s\".\n", parsed_cmd[0]); 74 | 75 | /* Free memory */ 76 | free(parsed_cmd); 77 | } 78 | 79 | return 0; 80 | } 81 | -------------------------------------------------------------------------------- /code-examples/.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace API.Controllers 9 | { 10 | [ApiController] 11 | [Route("[controller]")] 12 | public class WeatherForecastController : ControllerBase 13 | { 14 | private static readonly string[] Summaries = new[] 15 | { 16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 17 | }; 18 | 19 | public ThisShowcase(string name) 20 | { 21 | this.name = name; 22 | } 23 | 24 | private readonly ILogger _logger; 25 | 26 | public WeatherForecastController(ILogger logger) 27 | { 28 | _logger = logger; 29 | } 30 | 31 | [HttpGet] 32 | public IEnumerable Get() 33 | { 34 | var rng = new Random(); 35 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 36 | { 37 | Date = DateTime.Now.AddDays(index), 38 | TemperatureC = rng.Next(-20, 55), 39 | Summary = Summaries[rng.Next(Summaries.Length)] 40 | }) 41 | .ToArray(); 42 | } 43 | } 44 | } 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /code-examples/.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Questrial); 2 | @import url(http://fonts.googleapis.com/css?family=Arvo); 3 | @font-face { 4 | src: url(http://lea.verou.me/logo.otf); 5 | font-family: "LeaVerou"; 6 | } 7 | /* 8 | Shared styles 9 | */ 10 | 11 | section h1, 12 | #features li strong, 13 | header h2, 14 | footer p { 15 | font: 16 | 100% Rockwell, 17 | Arvo, 18 | serif; 19 | } 20 | /* 21 | Styles 22 | */ 23 | 24 | * { 25 | margin: 0; 26 | padding: 0; 27 | font-weight: normal; 28 | } 29 | body { 30 | font: 31 | 100%/1.5 Questrial, 32 | sans-serif; 33 | tab-size: 4; 34 | hyphens: auto; 35 | } 36 | a { 37 | color: inherit; 38 | } 39 | section h1 { 40 | font-size: 250%; 41 | } 42 | section section h1 { 43 | font-size: 150%; 44 | } 45 | section h1 code { 46 | font-style: normal; 47 | } 48 | section h1 > a { 49 | text-decoration: none; 50 | } 51 | section h1 > a:before { 52 | content: "§"; 53 | position: absolute; 54 | padding: 0 0.2em; 55 | margin-left: -1em; 56 | border-radius: 0.2em; 57 | color: silver; 58 | text-shadow: 0 1px white; 59 | } 60 | section h1 > a:hover:before { 61 | color: black; 62 | background: #f1ad26; 63 | } 64 | p { 65 | margin: 1em 0; 66 | } 67 | section h1, 68 | h2 { 69 | margin: 1em 0 0.3em; 70 | } 71 | dt { 72 | margin: 1em 0 0 0; 73 | font-size: 130%; 74 | } 75 | dt:after { 76 | content: ":"; 77 | } 78 | dd { 79 | margin-left: 2em; 80 | } 81 | strong { 82 | font-weight: bold; 83 | } 84 | code, 85 | pre { 86 | font-family: Consolas, Monaco, "Andale Mono", "Lucida Console", monospace; 87 | hyphens: none; 88 | } 89 | pre { 90 | max-height: 30em; 91 | overflow: auto; 92 | } 93 | pre > code.highlight { 94 | outline: 0.4em solid red; 95 | outline-offset: 0.4em; 96 | } 97 | header, 98 | body > section { 99 | display: block; 100 | max-width: 900px; 101 | margin: auto; 102 | } 103 | header, 104 | footer { 105 | position: relative; 106 | padding: 30px -webkit-calc(50% - 450px); 107 | /* Workaround for bug */ 108 | 109 | padding: 30px calc(50% - 450px); 110 | color: white; 111 | text-shadow: 0 -1px 2px black; 112 | background: url(img/spectrum.png) fixed; 113 | } 114 | header:before, 115 | footer:before { 116 | content: ""; 117 | position: absolute; 118 | bottom: 0; 119 | left: 0; 120 | right: 0; 121 | height: 20px; 122 | background-size: 20px 40px; 123 | background-repeat: repeat-x; 124 | } 125 | header { 126 | } 127 | header .intro, 128 | html.simple header { 129 | overflow: hidden; 130 | } 131 | header h1 { 132 | float: left; 133 | margin-right: 30px; 134 | color: #7fab14; 135 | text-align: center; 136 | font-size: 140%; 137 | text-transform: uppercase; 138 | letter-spacing: 0.25em; 139 | } 140 | header h2 { 141 | margin-top: 0.5em; 142 | color: #f1ad26; 143 | } 144 | header h1 a { 145 | text-decoration: none; 146 | } 147 | header img { 148 | display: block; 149 | width: 150px; 150 | height: 128px; 151 | margin-bottom: 0.3em; 152 | border: 0; 153 | } 154 | header h2 { 155 | font-size: 300%; 156 | } 157 | header .intro p { 158 | margin: 0; 159 | font: 160 | 150%/1.4 Questrial, 161 | sans-serif; 162 | font-size: 150%; 163 | } 164 | #features { 165 | width: 66em; 166 | margin-top: 2em; 167 | font-size: 80%; 168 | } 169 | #features li { 170 | margin: 0 0 2em 0; 171 | list-style: none; 172 | display: inline-block; 173 | width: 27em; 174 | vertical-align: top; 175 | } 176 | #features li:nth-child(odd) { 177 | margin-right: 5em; 178 | } 179 | #features li:before { 180 | content: "✓"; 181 | float: left; 182 | margin-left: -0.8em; 183 | color: #7fab14; 184 | font-size: 400%; 185 | line-height: 1; 186 | } 187 | #features li strong { 188 | display: block; 189 | margin-bottom: 0.1em; 190 | font-size: 200%; 191 | } 192 | header .download-button { 193 | float: right; 194 | margin: 0 0 0.5em 0.5em; 195 | } 196 | #theme { 197 | position: relative; 198 | z-index: 1; 199 | float: right; 200 | margin-right: -1em; 201 | text-align: center; 202 | text-transform: uppercase; 203 | letter-spacing: 0.2em; 204 | } 205 | #theme > p { 206 | position: absolute; 207 | left: 100%; 208 | transform: translateX(50%) rotate(90deg); 209 | transform-origin: top left; 210 | font-size: 130%; 211 | } 212 | #theme > label { 213 | position: relative; 214 | display: block; 215 | width: 7em; 216 | line-height: 1em; 217 | padding: 3em 0; 218 | border-radius: 50%; 219 | background: hsla(0, 0%, 100%, 0.5); 220 | cursor: pointer; 221 | font-size: 110%; 222 | } 223 | #theme > label:before { 224 | content: ""; 225 | position: absolute; 226 | top: 0; 227 | right: 0; 228 | bottom: 0; 229 | left: 0; 230 | z-index: -1; 231 | border-radius: inherit; 232 | background: url(img/spectrum.png) fixed; 233 | } 234 | #theme > label:nth-of-type(n + 2) { 235 | margin-top: -2.5em; 236 | } 237 | #theme > input:not(:checked) + label:hover { 238 | background: hsla(77, 80%, 60%, 0.5); 239 | } 240 | #theme > input { 241 | position: absolute; 242 | clip: rect(0, 0, 0, 0); 243 | } 244 | #theme > input:checked + label { 245 | background: #7fab14; 246 | } 247 | footer { 248 | margin-top: 2em; 249 | background-position: bottom; 250 | color: white; 251 | text-shadow: 0 -1px 2px black; 252 | } 253 | footer:before { 254 | bottom: auto; 255 | top: 0; 256 | background-position: bottom; 257 | } 258 | footer p { 259 | font-size: 150%; 260 | } 261 | footer ul { 262 | column-count: 3; 263 | } 264 | .download-button { 265 | display: block; 266 | padding: 0.2em 0.8em 0.1em; 267 | border: 1px solid rgba(0, 0, 0, 0.5); 268 | border-radius: 10px; 269 | background: #39a1cf; 270 | color: white; 271 | text-shadow: 0 -1px 2px black; 272 | text-align: center; 273 | font-size: 250%; 274 | line-height: 1.5; 275 | text-transform: uppercase; 276 | text-decoration: none; 277 | hyphens: manual; 278 | } 279 | .download-button:hover { 280 | background-color: #7fab14; 281 | } 282 | .download-button:active { 283 | box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8); 284 | } 285 | #toc { 286 | position: fixed; 287 | left: 1%; 288 | max-width: calc(48% - 450px); 289 | font-size: 80%; 290 | opacity: 0.3; 291 | } 292 | @media (max-width: 1200px) { 293 | #toc { 294 | display: none; 295 | } 296 | } 297 | #toc:hover { 298 | opacity: 1; 299 | } 300 | #toc h1 { 301 | font-size: 180%; 302 | } 303 | #toc li { 304 | list-style: none; 305 | } 306 | #logo:before { 307 | content: "☠"; 308 | float: right; 309 | font: 100px/1.6 LeaVerou; 310 | } 311 | .used-by-logos { 312 | overflow: hidden; 313 | } 314 | .used-by-logos > a { 315 | float: left; 316 | width: 33.33%; 317 | height: 100px; 318 | text-align: center; 319 | background: #f5f2f0; 320 | box-sizing: border-box; 321 | border: 5px solid white; 322 | position: relative; 323 | } 324 | .used-by-logos > .uswds { 325 | background: url("img/screen-us-web-design-standards.png") no-repeat 0 0; 326 | background-size: cover; 327 | text-indent: -999em; 328 | } 329 | .used-by-logos > a > img { 330 | max-height: 100%; 331 | max-width: 100%; 332 | position: absolute; 333 | top: 50%; 334 | left: 50%; 335 | transform: translate(-50%, -50%); 336 | } 337 | label a.owner { 338 | margin: 0 0.5em; 339 | } 340 | label a.owner:not(:hover) { 341 | text-decoration: none; 342 | color: #aaa; 343 | } 344 | #languages-list ul { 345 | column-count: 3; 346 | } 347 | #languages-list li { 348 | padding: 0.2em; 349 | } 350 | #languages-list li[data-id="javascript"] { 351 | border-bottom: 1px solid #aaa; 352 | padding-bottom: 1em; 353 | margin-bottom: 1em; 354 | margin-right: 1em; 355 | } 356 | -------------------------------------------------------------------------------- /code-examples/.go: -------------------------------------------------------------------------------- 1 | package badger 2 | 3 | import ( 4 | "bytes" 5 | "container/heap" 6 | "fmt" 7 | "math" 8 | "strconv" 9 | "sync" 10 | "sync/atomic" 11 | "time" 12 | 13 | "github.com/dgraph-io/badger/y" 14 | farm "github.com/dgryski/go-farm" 15 | "github.com/pkg/errors" 16 | ) 17 | 18 | type uint64Heap []uint64 19 | 20 | func (u uint64Heap) Len() int { return len(u) } 21 | func (u uint64Heap) Less(i int, j int) bool { return u[i] < u[j] } 22 | func (u uint64Heap) Swap(i int, j int) { u[i], u[j] = u[j], u[i] } 23 | func (u *uint64Heap) Push(x interface{}) { *u = append(*u, x.(uint64)) } 24 | func (u *uint64Heap) Pop() interface{} { 25 | old := *u 26 | n := len(old) 27 | x := old[n-1] 28 | *u = old[0 : n-1] 29 | return x 30 | } 31 | 32 | type oracle struct { 33 | curRead uint64 // Managed by the mutex. 34 | refCount int64 35 | isManaged bool // Does not change value, so no locking required. 36 | 37 | sync.Mutex 38 | nextCommit uint64 39 | 40 | // These two structures are used to figure out when a commit is done. The minimum done commit is 41 | // used to update curRead. 42 | commitMark uint64Heap 43 | pendingCommits map[uint64]struct{} 44 | 45 | // commits stores a key fingerprint and latest commit counter for it. 46 | // refCount is used to clear out commits map to avoid a memory blowup. 47 | commits map[uint64]uint64 48 | } 49 | 50 | func (o *oracle) addRef() { 51 | atomic.AddInt64(&o.refCount, 1) 52 | } 53 | 54 | func (o *oracle) decrRef() { 55 | if count := atomic.AddInt64(&o.refCount, -1); count == 0 { 56 | // Clear out pendingCommits maps to release memory. 57 | o.Lock() 58 | y.AssertTrue(len(o.commitMark) == 0) 59 | y.AssertTrue(len(o.pendingCommits) == 0) 60 | if len(o.commits) >= 1000 { // If the map is still small, let it slide. 61 | o.commits = make(map[uint64]uint64) 62 | } 63 | o.Unlock() 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /code-examples/.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | Prism 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 |
22 |
27 | 28 |
    29 |
  • 30 | Dead simple 31 | Include prism.css and prism.js, use proper HTML5 code tags 32 | (code.language-xxxx), done! 33 |
  • 34 |
  • 35 | Intuitive 36 | Language classes are inherited so you can only define the language 37 | once for multiple code snippets. 38 |
  • 39 |
  • 40 | Light as a feather 41 | The core is 2KB minified & gzipped. Languages add 0.3-0.5KB each, 42 | themes are around 1KB. 43 |
  • 44 |
  • 45 | Blazing fast 46 | Supports parallelism with Web Workers, if available. 47 |
  • 48 |
  • 49 | Extensible 50 | Define new languages or extend existing ones. Add new features thanks 51 | to Prism’s plugin architecture. 52 |
  • 53 |
  • 54 | Easy styling 55 | All styling is done through CSS, with sensible class names like 56 | .comment, .string, 57 | .property etc 58 |
  • 59 |
60 |
61 | 62 |
63 |

Used By

64 | 65 |

66 | Prism is used on several websites, small and large. Some of them are: 67 |

68 | 69 |
70 | Smashing Magazine 73 | U.S. Web Design Standards 79 | A List Apart 82 | 83 | Mozilla Developer Network (MDN) 86 | CSS-Tricks 89 | SitePoint 92 | Drupal 95 |
96 | 97 |

98 | It’s also used on 99 | the personal blog of Brendan Eich, creator of JavaScript itself! 104 |

105 |
106 | 107 |
108 |

Examples

109 | 110 |

111 | The Prism source, highlighted with Prism (don’t you just love how meta 112 | this is?): 113 |

114 |

115 | 
116 | 			

This page’s CSS code, highlighted with Prism:

117 |

118 | 
119 | 			

This page’s HTML, highlighted with Prism:

120 |

121 | 
122 | 			

This page’s logo (SVG), highlighted with Prism:

123 |

124 | 
125 | 			

126 | If you’re still not sold, you can 127 | view more examples or 128 | try it out for yourself. 129 |

130 |
131 | 132 |
133 |

Full list of features

134 |
    135 |
  • 136 | Only 2KB minified & gzipped (core). Each language 137 | definition adds roughly 300-500 bytes. 138 |
  • 139 |
  • 140 | Encourages good author practices. Other highlighters encourage or even 141 | force you to use elements that are semantically wrong, like 142 | <pre> (on its own) or <script>. Prism 143 | forces you to use the correct element for marking up code: 144 | <code>. On its own for inline code, or inside a 145 | <pre> for blocks of code. In addition, the language is defined 146 | through the way recommended in the HTML5 draft: through a 147 | language-xxxx class. 148 |
  • 149 |
  • 150 | The language definition is inherited. This means that if multiple code 151 | snippets have the same language, you can just define it once, in one 152 | of their common ancestors. 153 |
  • 154 |
  • 155 | Supports parallelism with Web Workers, if available. 156 | Disabled by default (why?). 160 |
  • 161 |
  • 162 | Very easy to extend without modifying the code, due to Prism’s 163 | plugin architecture. Multiple hooks are 164 | scattered throughout the source. 165 |
  • 166 |
  • 167 | Very easy to 168 | define new languages. Only thing you need is a good understanding of regular expressions 170 |
  • 171 |
  • 172 | All styling is done through CSS, with 173 | sensible class names 176 | rather than ugly namespaced abbreviated nonsense. 177 |
  • 178 |
  • 179 | Wide browser support: IE9+, Firefox, Chrome, Safari, 180 | Opera, most 181 | Mobile browsers 182 |
  • 183 |
  • 184 | Highlights embedded languages (e.g. CSS inside HTML, JavaScript inside 185 | HTML) 186 |
  • 187 |
  • Highlights inline code as well, not just code blocks
  • 188 |
  • Highlights nested languages (CSS in HTML, JavaScript in HTML)
  • 189 |
  • 190 | It doesn’t force you to use any Prism-specific markup, not even a 191 | Prism-specific class name, only standard markup you should be using 192 | anyway. So, you can just try it for a while, remove it if you don’t 193 | like it and leave no traces behind. 194 |
  • 195 |
  • 196 | Highlight specific lines and/or line ranges (requires 197 | plugin) 198 |
  • 199 |
  • 200 | Show invisible characters like tabs, line breaks etc (requires 201 | plugin) 202 |
  • 203 |
  • 204 | Autolink URLs and emails, use Markdown links in comments (requires 205 | plugin) 206 |
  • 207 |
208 |
209 | 210 |
211 |

Limitations

212 |
    213 |
  • 214 | Any pre-existing HTML in the code will be stripped off. 215 | There are ways around it though. 219 |
  • 220 |
  • 221 | Regex-based so it *will* fail on 222 | certain edge cases. 223 |
  • 224 |
  • 225 | No IE 6-8 support. If someone can read code, they are probably in the 226 | 85% of the population with a modern browser. 227 |
  • 228 |
229 |
230 | 231 |
232 |

Basic usage

233 | 234 |

235 | You will need to include the prism.css and 236 | prism.js files you downloaded in your page. Example: 237 |

238 |
<!DOCTYPE html>
239 | <html>
240 | <head>
241 |     ...
242 |     <link href="themes/prism.css" rel="stylesheet" />
243 | </head>
244 | <body>
245 |     ...
246 |     <script src="prism.js"></script>
247 | </body>
248 | </html>
249 | 250 |

251 | Prism does its best to encourage good authoring practices. Therefore, it 252 | only works with <code> elements, since marking up code 253 | without a <code> element is semantically invalid. 254 | According to the HTML5 spec, the recommended way to define a code language is a 258 | language-xxxx class, which is what Prism uses. To make 259 | things easier however, Prism assumes that this language definition is 260 | inherited. Therefore, if multiple <code> elements have 261 | the same language, you can add the language-xxxx class on 262 | one of their common ancestors. This way, you can also define a 263 | document-wide default language, by adding a 264 | language-xxxx class on the <body> or 265 | <html> element. 266 |

267 | 268 |

269 | If you want to opt-out of highlighting for a 270 | <code> element that is a descendant of an element with a 271 | declared code language, you can add the class 272 | language-none to it (or any non-existing language, really). 273 |

274 | 275 |

276 | The 277 | recommended way to mark up a code block 281 | (both for semantics and for Prism) is a <pre> element 282 | with a <code> element inside, like so: 283 |

284 |
<pre><code class="language-css">p { color: red }</code></pre>
285 |

286 | If you use that pattern, the <pre> will automatically 287 | get the language-xxxx class (if it doesn’t already have it) 288 | and will be styled as a code block. 289 |

290 | 291 |

292 | If you want to prevent any elements from being automatically 293 | highlighted, you can use the attribute data-manual on the 294 | <script> element you used for prism and use the 295 | API. Example: 296 |

297 |
<script src="prism.js" data-manual></script>
298 | 299 |

300 | If you want to use Prism on the server or through the command line, 301 | Prism can be used with Node.js as well. This might be useful if you're 302 | trying to generate static HTML pages with highlighted code for 303 | environments that don't support browser-side JS, like 304 | AMP pages. 305 |

306 | 307 |

You can install Prism for Node.js by running:

308 |
$ npm install prismjs
309 | 310 |

Example:

311 |
var Prism = require('prismjs');
312 | 
313 | // The code snippet you want to highlight, as a string
314 | var code = "var data = 1;";
315 | 
316 | // Returns a highlighted HTML string
317 | var html = Prism.highlight(code, Prism.languages.javascript);
318 |
319 | 320 |
321 |

Supported languages

322 |

323 | This is the list of all 324 | languages currently supported by 325 | Prism, with their corresponding alias, to use in place of 326 | xxxx in the language-xxxx class: 327 |

328 |
329 | 330 |
331 |

Plugins

332 |

333 | Plugins are additional scripts (and CSS code) that extend Prism’s 334 | functionality. Many of the following plugins are official, but are 335 | released as plugins to keep the Prism Core small for those who don’t 336 | need the extra functionality. 337 |

338 |
    339 | 340 |

    341 | No assembly required to use them. Just select them in the 342 | download page. 343 |

    344 |

    345 | It’s very easy to 346 | write your own Prism plugins. Did you write a plugin for Prism that you want added to this list? 348 | Send a pull request! 351 |

    352 |
    353 | 354 |
    355 |

    Third-party language definitions

    356 | 357 | 364 |
    365 | 366 |
    367 |

    Third-party tutorials

    368 | 369 |

    370 | Several tutorials have been written by members of the community to help 371 | you integrate Prism into multiple different website types and 372 | configurations: 373 |

    374 | 375 | 446 | 447 |

    448 | Please note that the tutorials listed here are not verified to contain 449 | correct information. Read at your risk and always check the official 450 | documentation here if something doesn’t work :) 451 |

    452 | 453 |

    454 | Have you written a tutorial about Prism that’s not already included 455 | here? Send a pull request! 456 |

    457 |
    458 | 459 |
    460 |

    Credits

    461 | 494 |
    495 | 496 |
    497 | 498 | 499 | 500 | 501 | 502 | 536 | 537 | 538 | -------------------------------------------------------------------------------- /code-examples/.java: -------------------------------------------------------------------------------- 1 | package globals; 2 | 3 | import java.io.BufferedInputStream; 4 | import java.io.FileInputStream; 5 | import java.io.FileNotFoundException; 6 | 7 | import org.apache.commons.codec.binary.Base64; 8 | 9 | import java.security.KeyStore; 10 | import java.security.PrivateKey; 11 | import java.security.PublicKey; 12 | import java.security.Signature; 13 | import java.security.SignatureException; 14 | import java.security.cert.Certificate; 15 | import java.security.cert.CertificateEncodingException; 16 | import java.security.cert.CertificateFactory; 17 | import java.security.cert.X509Certificate; 18 | 19 | 20 | import java.lang.Thread; 21 | 22 | public class Resources { 23 | 24 | // ------- PORTS ------------ 25 | public static final int REGISTRY_PORT = 1099; 26 | 27 | // ------- OTHER ------------ 28 | public static final String CA_DIGEST = "SHA-256"; 29 | 30 | // ------- CERTIFICATES ------------ 31 | 32 | public static Certificate readCertificateFile(String certificateFilePath) throws Exception { 33 | FileInputStream fis; 34 | 35 | try { fis = new FileInputStream(certificateFilePath); } 36 | catch (FileNotFoundException e) { 37 | System.err.println(ERROR_MSG("Certificate File not found: " + certificateFilePath)); 38 | return null; 39 | } 40 | BufferedInputStream bis = new BufferedInputStream(fis); 41 | CertificateFactory cf = CertificateFactory.getInstance("X.509"); 42 | 43 | if (bis.available() > 0) { return cf.generateCertificate(bis); } 44 | bis.close(); 45 | fis.close(); 46 | return null; 47 | } 48 | 49 | public static boolean verifySignedCertificate(Certificate certificate, PublicKey caPublicKey) { 50 | try { certificate.verify(caPublicKey); } 51 | catch (Exception e) { 52 | return false; 53 | } 54 | return true; 55 | } 56 | 57 | public static String convertToPemCertificate(X509Certificate certificate) { 58 | Base64 encoder = new Base64(64, "\n".getBytes()); 59 | String cert_begin = "-----BEGIN CERTIFICATE-----\n"; 60 | String end_cert = "-----END CERTIFICATE-----\n"; 61 | 62 | byte[] derCert = null; 63 | try { 64 | derCert = certificate.getEncoded(); 65 | } catch (CertificateEncodingException e) { 66 | System.err.println(WARNING_MSG("Error in certificate conversion :" + e.getMessage())); 67 | return null; 68 | } 69 | String pemCertPre = new String(encoder.encode(derCert)); 70 | String pemCert = cert_begin + pemCertPre + end_cert; 71 | return pemCert; 72 | } 73 | 74 | // ----------------------------------- 75 | 76 | 77 | // ------- SIGNATURES ------------ 78 | 79 | public static byte[] makeDigitalSignature(byte[] bytes, PrivateKey privateKey) throws Exception { 80 | Signature sig = Signature.getInstance("SHA1WithRSA"); 81 | sig.initSign(privateKey); 82 | sig.update(bytes); 83 | byte[] signature = sig.sign(); 84 | return signature; 85 | } 86 | 87 | public static boolean verifyDigitalSignature(byte[] cipherDigest, byte[] bytes, PublicKey publicKey) throws Exception { 88 | Signature sig = Signature.getInstance("SHA1WithRSA"); 89 | sig.initVerify(publicKey); 90 | sig.update(bytes); 91 | try { 92 | return sig.verify(cipherDigest); 93 | } catch (SignatureException se) { 94 | System.err.println(WARNING_MSG("Invalid Signature :" + se.getMessage())); 95 | return false; 96 | } 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /code-examples/.js: -------------------------------------------------------------------------------- 1 | /* ********************************************** 2 | Begin prism-core.js 3 | ********************************************** */ 4 | 5 | var _self = 6 | typeof window !== "undefined" 7 | ? window // if in browser 8 | : typeof WorkerGlobalScope !== "undefined" && 9 | self instanceof WorkerGlobalScope 10 | ? self // if in worker 11 | : {}; // if in node js 12 | 13 | /** 14 | * Prism: Lightweight, robust, elegant syntax highlighting 15 | * MIT license http://www.opensource.org/licenses/mit-license.php/ 16 | * @author Lea Verou http://lea.verou.me 17 | */ 18 | 19 | var Prism = (function () { 20 | // Private helper vars 21 | var lang = /\blang(?:uage)?-(\w+)\b/i; 22 | var uniqueId = 0; 23 | 24 | var _ = (_self.Prism = { 25 | manual: _self.Prism && _self.Prism.manual, 26 | util: { 27 | encode: function (tokens) { 28 | if (tokens instanceof Token) { 29 | return new Token( 30 | tokens.type, 31 | _.util.encode(tokens.content), 32 | tokens.alias, 33 | ); 34 | } else if (_.util.type(tokens) === "Array") { 35 | return tokens.map(_.util.encode); 36 | } else { 37 | return tokens 38 | .replace(/&/g, "&") 39 | .replace(/ text.length) { 328 | // Something went terribly wrong, ABORT, ABORT! 329 | return; 330 | } 331 | 332 | if (str instanceof Token) { 333 | continue; 334 | } 335 | 336 | pattern.lastIndex = 0; 337 | 338 | var match = pattern.exec(str), 339 | delNum = 1; 340 | 341 | // Greedy patterns can override/remove up to two previously matched tokens 342 | if (!match && greedy && i != strarr.length - 1) { 343 | pattern.lastIndex = pos; 344 | match = pattern.exec(text); 345 | if (!match) { 346 | break; 347 | } 348 | 349 | var from = match.index + (lookbehind ? match[1].length : 0), 350 | to = match.index + match[0].length, 351 | k = i, 352 | p = pos; 353 | 354 | for ( 355 | var len = strarr.length; 356 | k < len && 357 | (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); 358 | ++k 359 | ) { 360 | p += strarr[k].length; 361 | // Move the index i to the element in strarr that is closest to from 362 | if (from >= p) { 363 | ++i; 364 | pos = p; 365 | } 366 | } 367 | 368 | /* 369 | * If strarr[i] is a Token, then the match starts inside another Token, which is invalid 370 | * If strarr[k - 1] is greedy we are in conflict with another greedy pattern 371 | */ 372 | if (strarr[i] instanceof Token || strarr[k - 1].greedy) { 373 | continue; 374 | } 375 | 376 | // Number of tokens to delete and replace with the new match 377 | delNum = k - i; 378 | str = text.slice(pos, p); 379 | match.index -= pos; 380 | } 381 | 382 | if (!match) { 383 | if (oneshot) { 384 | break; 385 | } 386 | 387 | continue; 388 | } 389 | 390 | if (lookbehind) { 391 | lookbehindLength = match[1].length; 392 | } 393 | 394 | var from = match.index + lookbehindLength, 395 | match = match[0].slice(lookbehindLength), 396 | to = from + match.length, 397 | before = str.slice(0, from), 398 | after = str.slice(to); 399 | 400 | var args = [i, delNum]; 401 | 402 | if (before) { 403 | ++i; 404 | pos += before.length; 405 | args.push(before); 406 | } 407 | 408 | var wrapped = new Token( 409 | token, 410 | inside ? _.tokenize(match, inside) : match, 411 | alias, 412 | match, 413 | greedy, 414 | ); 415 | 416 | args.push(wrapped); 417 | 418 | if (after) { 419 | args.push(after); 420 | } 421 | 422 | Array.prototype.splice.apply(strarr, args); 423 | 424 | if (delNum != 1) 425 | _.matchGrammar(text, strarr, grammar, i, pos, true, token); 426 | 427 | if (oneshot) break; 428 | } 429 | } 430 | } 431 | }, 432 | 433 | tokenize: function (text, grammar, language) { 434 | var strarr = [text]; 435 | 436 | var rest = grammar.rest; 437 | 438 | if (rest) { 439 | for (var token in rest) { 440 | grammar[token] = rest[token]; 441 | } 442 | 443 | delete grammar.rest; 444 | } 445 | 446 | _.matchGrammar(text, strarr, grammar, 0, 0, false); 447 | 448 | return strarr; 449 | }, 450 | 451 | hooks: { 452 | all: {}, 453 | 454 | add: function (name, callback) { 455 | var hooks = _.hooks.all; 456 | 457 | hooks[name] = hooks[name] || []; 458 | 459 | hooks[name].push(callback); 460 | }, 461 | 462 | run: function (name, env) { 463 | var callbacks = _.hooks.all[name]; 464 | 465 | if (!callbacks || !callbacks.length) { 466 | return; 467 | } 468 | 469 | for (var i = 0, callback; (callback = callbacks[i++]); ) { 470 | callback(env); 471 | } 472 | }, 473 | }, 474 | }); 475 | 476 | var Token = (_.Token = function (type, content, alias, matchedStr, greedy) { 477 | this.type = type; 478 | this.content = content; 479 | this.alias = alias; 480 | // Copy of the full string this token was created from 481 | this.length = (matchedStr || "").length | 0; 482 | this.greedy = !!greedy; 483 | }); 484 | 485 | Token.stringify = function (o, language, parent) { 486 | if (typeof o == "string") { 487 | return o; 488 | } 489 | 490 | if (_.util.type(o) === "Array") { 491 | return o 492 | .map(function (element) { 493 | return Token.stringify(element, language, o); 494 | }) 495 | .join(""); 496 | } 497 | 498 | var env = { 499 | type: o.type, 500 | content: Token.stringify(o.content, language, parent), 501 | tag: "span", 502 | classes: ["token", o.type], 503 | attributes: {}, 504 | language: language, 505 | parent: parent, 506 | }; 507 | 508 | if (env.type == "comment") { 509 | env.attributes["spellcheck"] = "true"; 510 | } 511 | 512 | if (o.alias) { 513 | var aliases = _.util.type(o.alias) === "Array" ? o.alias : [o.alias]; 514 | Array.prototype.push.apply(env.classes, aliases); 515 | } 516 | 517 | _.hooks.run("wrap", env); 518 | 519 | var attributes = Object.keys(env.attributes) 520 | .map(function (name) { 521 | return ( 522 | name + 523 | '="' + 524 | (env.attributes[name] || "").replace(/"/g, """) + 525 | '"' 526 | ); 527 | }) 528 | .join(" "); 529 | 530 | return ( 531 | "<" + 532 | env.tag + 533 | ' class="' + 534 | env.classes.join(" ") + 535 | '"' + 536 | (attributes ? " " + attributes : "") + 537 | ">" + 538 | env.content + 539 | "" 542 | ); 543 | }; 544 | 545 | if (!_self.document) { 546 | if (!_self.addEventListener) { 547 | // in Node.js 548 | return _self.Prism; 549 | } 550 | // In worker 551 | _self.addEventListener( 552 | "message", 553 | function (evt) { 554 | var message = JSON.parse(evt.data), 555 | lang = message.language, 556 | code = message.code, 557 | immediateClose = message.immediateClose; 558 | 559 | _self.postMessage(_.highlight(code, _.languages[lang], lang)); 560 | if (immediateClose) { 561 | _self.close(); 562 | } 563 | }, 564 | false, 565 | ); 566 | 567 | return _self.Prism; 568 | } 569 | 570 | //Get current script and highlight 571 | var script = 572 | document.currentScript || 573 | [].slice.call(document.getElementsByTagName("script")).pop(); 574 | 575 | if (script) { 576 | _.filename = script.src; 577 | 578 | if (!_.manual && !script.hasAttribute("data-manual")) { 579 | if (document.readyState !== "loading") { 580 | if (window.requestAnimationFrame) { 581 | window.requestAnimationFrame(_.highlightAll); 582 | } else { 583 | window.setTimeout(_.highlightAll, 16); 584 | } 585 | } else { 586 | document.addEventListener("DOMContentLoaded", _.highlightAll); 587 | } 588 | } 589 | } 590 | 591 | return _self.Prism; 592 | })(); 593 | 594 | if (typeof module !== "undefined" && module.exports) { 595 | module.exports = Prism; 596 | } 597 | 598 | // hack for components to work correctly in node.js 599 | if (typeof global !== "undefined") { 600 | global.Prism = Prism; 601 | } 602 | 603 | /* ********************************************** 604 | Begin prism-markup.js 605 | ********************************************** */ 606 | 607 | Prism.languages.markup = { 608 | comment: //, 609 | prolog: /<\?[\s\S]+?\?>/, 610 | doctype: //i, 611 | cdata: //i, 612 | tag: { 613 | pattern: 614 | /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i, 615 | inside: { 616 | tag: { 617 | pattern: /^<\/?[^\s>\/]+/i, 618 | inside: { 619 | punctuation: /^<\/?/, 620 | namespace: /^[^\s>\/:]+:/, 621 | }, 622 | }, 623 | "attr-value": { 624 | pattern: /=(?:('|")[\s\S]*?(\1)|[^\s>]+)/i, 625 | inside: { 626 | punctuation: /[=>"']/, 627 | }, 628 | }, 629 | punctuation: /\/?>/, 630 | "attr-name": { 631 | pattern: /[^\s>\/]+/, 632 | inside: { 633 | namespace: /^[^\s>\/:]+:/, 634 | }, 635 | }, 636 | }, 637 | }, 638 | entity: /&#?[\da-z]{1,8};/i, 639 | }; 640 | 641 | Prism.languages.markup["tag"].inside["attr-value"].inside["entity"] = 642 | Prism.languages.markup["entity"]; 643 | 644 | // Plugin to make entity title show the real entity, idea by Roman Komarov 645 | Prism.hooks.add("wrap", function (env) { 646 | if (env.type === "entity") { 647 | env.attributes["title"] = env.content.replace(/&/, "&"); 648 | } 649 | }); 650 | 651 | Prism.languages.xml = Prism.languages.markup; 652 | Prism.languages.html = Prism.languages.markup; 653 | Prism.languages.mathml = Prism.languages.markup; 654 | Prism.languages.svg = Prism.languages.markup; 655 | 656 | /* ********************************************** 657 | Begin prism-css.js 658 | ********************************************** */ 659 | 660 | Prism.languages.css = { 661 | comment: /\/\*[\s\S]*?\*\//, 662 | atrule: { 663 | pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i, 664 | inside: { 665 | rule: /@[\w-]+/, 666 | // See rest below 667 | }, 668 | }, 669 | url: /url\((?:(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, 670 | selector: /[^\{\}\s][^\{\};]*?(?=\s*\{)/, 671 | string: { 672 | pattern: /("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, 673 | greedy: true, 674 | }, 675 | property: /(\b|\B)[\w-]+(?=\s*:)/i, 676 | important: /\B!important\b/i, 677 | function: /[-a-z0-9]+(?=\()/i, 678 | punctuation: /[(){};:]/, 679 | }; 680 | 681 | Prism.languages.css["atrule"].inside.rest = Prism.util.clone( 682 | Prism.languages.css, 683 | ); 684 | 685 | if (Prism.languages.markup) { 686 | Prism.languages.insertBefore("markup", "tag", { 687 | style: { 688 | pattern: /()[\s\S]*?(?=<\/style>)/i, 689 | lookbehind: true, 690 | inside: Prism.languages.css, 691 | alias: "language-css", 692 | }, 693 | }); 694 | 695 | Prism.languages.insertBefore( 696 | "inside", 697 | "attr-value", 698 | { 699 | "style-attr": { 700 | pattern: /\s*style=("|').*?\1/i, 701 | inside: { 702 | "attr-name": { 703 | pattern: /^\s*style/i, 704 | inside: Prism.languages.markup.tag.inside, 705 | }, 706 | punctuation: /^\s*=\s*['"]|['"]\s*$/, 707 | "attr-value": { 708 | pattern: /.+/i, 709 | inside: Prism.languages.css, 710 | }, 711 | }, 712 | alias: "language-css", 713 | }, 714 | }, 715 | Prism.languages.markup.tag, 716 | ); 717 | } 718 | 719 | /* ********************************************** 720 | Begin prism-clike.js 721 | ********************************************** */ 722 | 723 | Prism.languages.clike = { 724 | comment: [ 725 | { 726 | pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, 727 | lookbehind: true, 728 | }, 729 | { 730 | pattern: /(^|[^\\:])\/\/.*/, 731 | lookbehind: true, 732 | }, 733 | ], 734 | string: { 735 | pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, 736 | greedy: true, 737 | }, 738 | "class-name": { 739 | pattern: 740 | /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i, 741 | lookbehind: true, 742 | inside: { 743 | punctuation: /(\.|\\)/, 744 | }, 745 | }, 746 | keyword: 747 | /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, 748 | boolean: /\b(true|false)\b/, 749 | function: /[a-z0-9_]+(?=\()/i, 750 | number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i, 751 | operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, 752 | punctuation: /[{}[\];(),.:]/, 753 | }; 754 | 755 | /* ********************************************** 756 | Begin prism-javascript.js 757 | ********************************************** */ 758 | 759 | Prism.languages.javascript = Prism.languages.extend("clike", { 760 | keyword: 761 | /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/, 762 | number: 763 | /\b-?(0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/, 764 | // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) 765 | function: /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i, 766 | operator: 767 | /-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/, 768 | }); 769 | 770 | Prism.languages.insertBefore("javascript", "keyword", { 771 | regex: { 772 | pattern: 773 | /(^|[^/])\/(?!\/)(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/, 774 | lookbehind: true, 775 | greedy: true, 776 | }, 777 | }); 778 | 779 | Prism.languages.insertBefore("javascript", "string", { 780 | "template-string": { 781 | pattern: /`(?:\\\\|\\?[^\\])*?`/, 782 | greedy: true, 783 | inside: { 784 | interpolation: { 785 | pattern: /\$\{[^}]+\}/, 786 | inside: { 787 | "interpolation-punctuation": { 788 | pattern: /^\$\{|\}$/, 789 | alias: "punctuation", 790 | }, 791 | rest: Prism.languages.javascript, 792 | }, 793 | }, 794 | string: /[\s\S]+/, 795 | }, 796 | }, 797 | }); 798 | 799 | if (Prism.languages.markup) { 800 | Prism.languages.insertBefore("markup", "tag", { 801 | script: { 802 | pattern: /()[\s\S]*?(?=<\/script>)/i, 803 | lookbehind: true, 804 | inside: Prism.languages.javascript, 805 | alias: "language-javascript", 806 | }, 807 | }); 808 | } 809 | 810 | Prism.languages.js = Prism.languages.javascript; 811 | 812 | /* ********************************************** 813 | Begin prism-file-highlight.js 814 | ********************************************** */ 815 | 816 | (function () { 817 | if ( 818 | typeof self === "undefined" || 819 | !self.Prism || 820 | !self.document || 821 | !document.querySelector 822 | ) { 823 | return; 824 | } 825 | 826 | self.Prism.fileHighlight = function () { 827 | var Extensions = { 828 | js: "javascript", 829 | py: "python", 830 | rb: "ruby", 831 | ps1: "powershell", 832 | psm1: "powershell", 833 | sh: "bash", 834 | bat: "batch", 835 | h: "c", 836 | tex: "latex", 837 | }; 838 | 839 | Array.prototype.slice 840 | .call(document.querySelectorAll("pre[data-src]")) 841 | .forEach(function (pre) { 842 | var src = pre.getAttribute("data-src"); 843 | 844 | var language, 845 | parent = pre; 846 | var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i; 847 | while (parent && !lang.test(parent.className)) { 848 | parent = parent.parentNode; 849 | } 850 | 851 | if (parent) { 852 | language = (pre.className.match(lang) || [, ""])[1]; 853 | } 854 | 855 | if (!language) { 856 | var extension = (src.match(/\.(\w+)$/) || [, ""])[1]; 857 | language = Extensions[extension] || extension; 858 | } 859 | 860 | var code = document.createElement("code"); 861 | code.className = "language-" + language; 862 | 863 | pre.textContent = ""; 864 | 865 | code.textContent = "Loading…"; 866 | 867 | pre.appendChild(code); 868 | 869 | var xhr = new XMLHttpRequest(); 870 | 871 | xhr.open("GET", src, true); 872 | 873 | xhr.onreadystatechange = function () { 874 | if (xhr.readyState == 4) { 875 | if (xhr.status < 400 && xhr.responseText) { 876 | code.textContent = xhr.responseText; 877 | 878 | Prism.highlightElement(code); 879 | } else if (xhr.status >= 400) { 880 | code.textContent = 881 | "✖ Error " + 882 | xhr.status + 883 | " while fetching file: " + 884 | xhr.statusText; 885 | } else { 886 | code.textContent = "✖ Error: File does not exist or is empty"; 887 | } 888 | } 889 | }; 890 | 891 | xhr.send(null); 892 | }); 893 | }; 894 | 895 | document.addEventListener("DOMContentLoaded", self.Prism.fileHighlight); 896 | })(); 897 | -------------------------------------------------------------------------------- /code-examples/.psm1: -------------------------------------------------------------------------------- 1 | Param( 2 | [Parameter(Mandatory=$True)] 3 | [string] 4 | $WorkingFolder 5 | ) 6 | 7 | $powershellScripts = Get-ChildItem -Path "$WorkingFolder" -Filter "*.ps1" -Exclude "*.tests.*" -Recurse -File 8 | 9 | Function Test-PowershellScript { 10 | Param( 11 | [string]$FilePath 12 | ) 13 | 14 | It "is a valid Powershell Code" { 15 | $psFile = Get-Content -Path $FilePath -ErrorAction Stop 16 | $errors = $null 17 | $null = [System.Management.Automation.PSParser]::Tokenize($psFile, [ref]$errors) 18 | $errors.Count | Should -Be 0 19 | } 20 | } 21 | 22 | ForEach ($powershellScript In $powershellScripts) { 23 | Describe $powershellScript.FullName.Replace($WorkingFolder, "") { 24 | Test-PowershellScript -FilePath $powershellScript.FullName 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /code-examples/.py: -------------------------------------------------------------------------------- 1 | '''Binary Tree node class and traversal functions 2 | 3 | A node object holds a value, and optional left and/or right child 4 | ''' 5 | 6 | class node: 7 | '''Binary Tree Node''' 8 | def __init__(self, value, left=None, right=None): 9 | self.value = value 10 | self.left = left 11 | self.right = right 12 | 13 | def __str__(self, unicode=True, spacing=' '): 14 | '''Returns subtree starting from this node 15 | 16 | Use the unicode flag to use unicode numbers (unicode characters are still used for the branches) 17 | ''' 18 | ret = '' 19 | if self.right: # right branch 20 | ret += self.right.__str__(spacing = spacing[:-2] + ('│ ' if spacing[-2:] == '└─' else ' ') + '┌─', unicode=unicode) 21 | ret += spacing + (chr(self.value + (10121 if self.value < 11 else 9440)) if unicode else str(self.value)) + '\n' 22 | if self.left: # left branch 23 | ret += self.left.__str__(spacing = spacing[:-2] + ('│ ' if spacing[-2:] == '┌─' else ' ') + '└─',unicode=unicode) 24 | 25 | return ret 26 | 27 | def __repr__(self): 28 | return "\n%s" % str(self.__str__())[:-1] 29 | 30 | def print_tree(self, unicode=True): 31 | '''Print subtree starting from this node''' 32 | print(str(self.__str__(unicode=unicode))[:-1]) -------------------------------------------------------------------------------- /code-examples/.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $ROOT_DIR 4 | DOT_FILES="lastpass weechat ssh Xauthority" 5 | for dotfile in $DOT_FILES; do conform_link "$DATA_DIR/$dotfile" ".$dotfile"; done 6 | 7 | case "$PLATFORM" in 8 | linux) 9 | #conform_link "$CONF_DIR/shell/zshenv" ".zshenv" 10 | crontab -l > $ROOT_DIR/tmp/crontab-conflict-arch 11 | cd $ROOT_DIR/$CONF_DIR/cron 12 | if [[ "$(diff ~/tmp/crontab-conflict-arch crontab-current-arch)" == "" 13 | ]]; 14 | then # no difference with current backup 15 | logger "$LOG_PREFIX: crontab live settings match stored "\ 16 | "settings; no restore required" 17 | rm ~/tmp/crontab-conflict-arch 18 | else # current crontab settings in file do not match live settings 19 | crontab $ROOT_DIR/$CONF_DIR/cron/crontab-current-arch 20 | logger "$LOG_PREFIX: crontab stored settings conflict with "\ 21 | "live settings; stored settings restored. "\ 22 | "Previous settings recorded in ~/tmp/crontab-conflict-arch." 23 | fi 24 | ;; 25 | -------------------------------------------------------------------------------- /code-examples/.ts: -------------------------------------------------------------------------------- 1 | interface SearchFunc { 2 | (source: string, subString: string): boolean; 3 | } 4 | 5 | var mySearch: SearchFunc; 6 | mySearch = function (source: string, subString: string) { 7 | var result = source.search(subString); 8 | if (result == -1) { 9 | return false; 10 | } else { 11 | return true; 12 | } 13 | }; 14 | 15 | class Greeter { 16 | greeting: string; 17 | constructor(message: string) { 18 | this.greeting = message; 19 | } 20 | greet() { 21 | return "Hello, " + this.greeting; 22 | } 23 | } 24 | 25 | var greeter = new Greeter("world"); 26 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | import eslint from "@eslint/js"; 4 | import tseslint from "typescript-eslint"; 5 | import eslintConfigPrettier from "eslint-config-prettier"; 6 | 7 | export default tseslint.config( 8 | eslint.configs.recommended, 9 | tseslint.configs.recommended, 10 | eslintConfigPrettier, 11 | ); 12 | -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdinhify/vscode-theme-gruvbox/4d4d768a93d3d28b31f8325481a0dae1b4b9e27a/images/icon.png -------------------------------------------------------------------------------- /images/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml 57 | 59 | 65 | 66 | 68 | 70 | 74 | 78 | 82 | 86 | 90 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /images/screenshots.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdinhify/vscode-theme-gruvbox/4d4d768a93d3d28b31f8325481a0dae1b4b9e27a/images/screenshots.jpg -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gruvbox", 3 | "displayName": "Gruvbox Theme", 4 | "description": "Gruvbox Theme", 5 | "version": "0.0.0", 6 | "author": "jdinhify (https://github.com/jdinhify)", 7 | "publisher": "jdinhlife", 8 | "engines": { 9 | "vscode": "^1.67.2" 10 | }, 11 | "categories": [ 12 | "Themes" 13 | ], 14 | "icon": "images/icon.png", 15 | "galleryBanner": { 16 | "color": "#3c3836", 17 | "theme": "dark" 18 | }, 19 | "homepage": "https://github.com/jdinhify/vscode-theme-gruvbox", 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/jdinhify/vscode-theme-gruvbox.git" 23 | }, 24 | "contributes": { 25 | "themes": [ 26 | { 27 | "label": "Gruvbox Dark Medium", 28 | "uiTheme": "vs-dark", 29 | "path": "./themes/gruvbox-dark-medium.json" 30 | }, 31 | { 32 | "label": "Gruvbox Dark Hard", 33 | "uiTheme": "vs-dark", 34 | "path": "./themes/gruvbox-dark-hard.json" 35 | }, 36 | { 37 | "label": "Gruvbox Dark Soft", 38 | "uiTheme": "vs-dark", 39 | "path": "./themes/gruvbox-dark-soft.json" 40 | }, 41 | { 42 | "label": "Gruvbox Light Medium", 43 | "uiTheme": "vs", 44 | "path": "./themes/gruvbox-light-medium.json" 45 | }, 46 | { 47 | "label": "Gruvbox Light Hard", 48 | "uiTheme": "vs", 49 | "path": "./themes/gruvbox-light-hard.json" 50 | }, 51 | { 52 | "label": "Gruvbox Light Soft", 53 | "uiTheme": "vs", 54 | "path": "./themes/gruvbox-light-soft.json" 55 | } 56 | ] 57 | }, 58 | "__metadata": { 59 | "id": "c6d564c4-ca8c-45ba-abf6-c85f2d1468d8", 60 | "publisherDisplayName": "jdinhify", 61 | "publisherId": "571210a8-f372-43c2-8b5a-018868d4ac96" 62 | }, 63 | "devDependencies": { 64 | "@eslint/js": "^9.21.0", 65 | "@types/node": "^22.13.7", 66 | "@vscode/vsce": "^3.2.2", 67 | "eslint": "^9.21.0", 68 | "eslint-config-prettier": "^10.0.2", 69 | "ovsx": "^0.10.1", 70 | "prettier": "3.5.2", 71 | "semantic-release": "^24.2.3", 72 | "tsx": "^4.19.3", 73 | "typescript": "^5.7.3", 74 | "typescript-eslint": "^8.25.0" 75 | }, 76 | "private": true, 77 | "scripts": { 78 | "semantic-release": "semantic-release", 79 | "dev": "tsx watch ./src/main.ts", 80 | "build": "tsx ./src/main.ts", 81 | "type:check": "tsc ./src/*.ts --noEmit", 82 | "lint:check": "eslint ./src", 83 | "format:check": "prettier ./src --check" 84 | }, 85 | "license": "MIT", 86 | "type": "module" 87 | } 88 | -------------------------------------------------------------------------------- /release.config.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {import('semantic-release').GlobalConfig} 3 | */ 4 | export default { 5 | branches: ["main"], 6 | plugins: [ 7 | "@semantic-release/commit-analyzer", 8 | "@semantic-release/release-notes-generator", 9 | "@semantic-release/github", 10 | ], 11 | }; 12 | -------------------------------------------------------------------------------- /src/colors/base.ts: -------------------------------------------------------------------------------- 1 | import { ColorScheme, ColorContrast, allColors, withAlpha } from "../shared"; 2 | 3 | export const getBaseColors = (scheme: ColorScheme, contrast: ColorContrast) => { 4 | const colors = allColors[scheme]; 5 | const { 6 | bg1, 7 | bg2, 8 | bg3, 9 | bg4, 10 | grey, 11 | fg1, 12 | fg2, 13 | fg3, 14 | fg4, 15 | red1, 16 | red2, 17 | green1, 18 | green2, 19 | yellow1, 20 | yellow2, 21 | blue1, 22 | blue2, 23 | purple1, 24 | purple2, 25 | aqua1, 26 | aqua2, 27 | orange1, 28 | orange2, 29 | transparent, 30 | white, 31 | } = colors; 32 | const bg0 = colors[`bg0_${contrast}`]; 33 | 34 | return { 35 | // BASE COLORS 36 | focusBorder: bg1, 37 | foreground: fg1, 38 | "widget.shadow": withAlpha(bg0, 48), 39 | "widget.border": bg1, 40 | "selection.background": withAlpha(aqua1, 128), 41 | errorForeground: red2, 42 | "icon.foreground": fg1, 43 | // BUTTON 44 | "button.background": withAlpha(blue1, 128), 45 | "button.foreground": fg1, 46 | "button.hoverBackground": withAlpha(blue1, 96), 47 | // DROPDOWN 48 | "dropdown.background": bg0, 49 | "dropdown.border": bg1, 50 | "dropdown.foreground": fg1, 51 | // INPUT 52 | "input.background": bg0, 53 | "input.border": bg1, 54 | "input.foreground": fg1, 55 | "input.placeholderForeground": withAlpha(fg1, 96), 56 | "inputValidation.errorBorder": red2, 57 | "inputValidation.errorBackground": red1, 58 | "inputValidation.infoBorder": blue2, 59 | "inputValidation.infoBackground": withAlpha(blue1, 128), 60 | "inputValidation.warningBorder": yellow2, 61 | "inputValidation.warningBackground": yellow1, 62 | "inputOption.activeBorder": withAlpha(fg1, 96), 63 | // SCROLL BAR 64 | "scrollbar.shadow": bg0, 65 | "scrollbarSlider.activeBackground": aqua1, 66 | "scrollbarSlider.hoverBackground": bg3, 67 | "scrollbarSlider.background": withAlpha(bg2, 153), 68 | // BADGE 69 | "badge.background": purple1, 70 | "badge.foreground": white, 71 | // PROGRESS BAR 72 | "progressBar.background": aqua1, 73 | // LISTS AND TREES 74 | "list.activeSelectionBackground": withAlpha(bg1, 128), 75 | "list.activeSelectionForeground": aqua2, 76 | "list.hoverBackground": withAlpha(bg1, 128), 77 | "list.hoverForeground": fg2, 78 | "list.focusBackground": bg1, 79 | "list.focusForeground": fg1, 80 | "list.inactiveSelectionForeground": aqua1, 81 | "list.inactiveSelectionBackground": withAlpha(bg1, 128), 82 | "list.dropBackground": bg1, 83 | "list.highlightForeground": aqua1, 84 | // SIDE BAR 85 | "sideBar.background": bg0, 86 | "sideBar.foreground": fg2, 87 | "sideBar.border": bg1, 88 | "sideBarTitle.foreground": fg1, 89 | "sideBarSectionHeader.background": transparent, 90 | "sideBarSectionHeader.foreground": fg1, 91 | // ACTIVITY BAR 92 | "activityBar.background": bg0, 93 | "activityBar.foreground": fg1, 94 | "activityBar.border": bg1, 95 | "activityBarTop.background": bg0, 96 | "activityBarTop.foreground": fg1, 97 | "activityBarBadge.background": blue1, 98 | "activityBarBadge.foreground": white, 99 | // EDITOR GROUPS 100 | "editorGroup.border": bg1, 101 | "editorGroup.dropBackground": withAlpha(bg1, 96), 102 | "editorGroupHeader.noTabsBackground": bg0, 103 | "editorGroupHeader.tabsBackground": bg0, 104 | "editorGroupHeader.tabsBorder": bg1, 105 | // TABS 106 | "tab.border": transparent, 107 | "tab.activeBorder": aqua1, 108 | "tab.activeBackground": bg1, 109 | "tab.activeForeground": fg1, 110 | "tab.inactiveForeground": fg4, 111 | "tab.inactiveBackground": bg0, 112 | "tab.unfocusedActiveForeground": fg4, 113 | "tab.unfocusedActiveBorder": transparent, 114 | "tab.unfocusedInactiveForeground": grey, 115 | // EDITOR 116 | "editor.background": bg0, 117 | "editor.foreground": fg1, 118 | "editorLineNumber.foreground": bg3, 119 | "editorCursor.foreground": fg1, 120 | "editor.selectionBackground": withAlpha(aqua1, 64), 121 | "editor.selectionHighlightBackground": withAlpha(yellow2, 64), 122 | "editor.hoverHighlightBackground": withAlpha(aqua1, 80), 123 | "editorLink.activeForeground": fg1, 124 | "editor.findMatchBackground": withAlpha(blue2, 112), 125 | "editor.findMatchHighlightBackground": withAlpha(orange2, 48), 126 | "editor.findRangeHighlightBackground": withAlpha(blue2, 112), 127 | "editor.lineHighlightBackground": withAlpha(bg1, 96), 128 | "editor.lineHighlightBorder": transparent, 129 | "editorWhitespace.foreground": withAlpha(fg4, 32), 130 | "editorRuler.foreground": withAlpha(fg4, 64), 131 | "editorCodeLens.foreground": withAlpha(fg4, 144), 132 | "editorBracketMatch.border": transparent, 133 | "editorBracketMatch.background": withAlpha(grey, 128), 134 | "editorHoverWidget.background": bg0, 135 | "editorHoverWidget.border": bg1, 136 | "editorOverviewRuler.border": transparent, 137 | "editorOverviewRuler.findMatchForeground": fg3, 138 | "editorOverviewRuler.rangeHighlightForeground": fg3, 139 | "editorOverviewRuler.selectionHighlightForeground": bg3, 140 | "editorOverviewRuler.wordHighlightForeground": bg3, 141 | "editorOverviewRuler.wordHighlightStrongForeground": bg3, 142 | "editorOverviewRuler.modifiedForeground": blue2, 143 | "editorOverviewRuler.addedForeground": blue2, 144 | "editorOverviewRuler.deletedForeground": blue2, 145 | "editorOverviewRuler.errorForeground": red2, 146 | "editorOverviewRuler.warningForeground": yellow1, 147 | "editorOverviewRuler.infoForeground": purple2, 148 | "editorGutter.background": transparent, 149 | "editorGutter.modifiedBackground": blue2, 150 | "editorGutter.addedBackground": green2, 151 | "editorGutter.deletedBackground": red2, 152 | "editorError.foreground": red1, 153 | "editorWarning.foreground": yellow1, 154 | "editorInfo.foreground": blue1, 155 | "editorIndentGuide.activeBackground": bg3, 156 | // EDITOR - BRACKET PAIR COLORIZATION 157 | "editorBracketHighlight.foreground1": purple1, 158 | "editorBracketHighlight.foreground2": blue1, 159 | "editorBracketHighlight.foreground3": aqua1, 160 | "editorBracketHighlight.foreground4": green1, 161 | "editorBracketHighlight.foreground5": yellow1, 162 | "editorBracketHighlight.foreground6": orange1, 163 | "editorBracketHighlight.unexpectedBracket.foreground": red1, 164 | // EDITOR - STICKY SCROLL 165 | "editorStickyScroll.shadow": withAlpha(bg2, 153), 166 | "editorStickyScrollHover.background": withAlpha(bg1, 96), 167 | // DIFF EDITOR 168 | "diffEditor.insertedTextBackground": withAlpha(green2, 48), 169 | "diffEditor.removedTextBackground": withAlpha(red2, 48), 170 | // WIDGET 171 | "editorWidget.background": bg0, 172 | "editorWidget.border": bg1, 173 | "editorSuggestWidget.background": bg0, 174 | "editorSuggestWidget.foreground": fg1, 175 | "editorSuggestWidget.highlightForeground": aqua1, 176 | "editorSuggestWidget.selectedBackground": withAlpha(bg1, 96), 177 | "editorSuggestWidget.border": bg1, 178 | // PEEK VIEW 179 | "peekView.border": bg1, 180 | "peekViewEditor.background": withAlpha(bg1, 112), 181 | "peekViewEditor.matchHighlightBackground": bg2, 182 | "peekViewEditorGutter.background": withAlpha(bg1, 112), 183 | "peekViewResult.background": withAlpha(bg1, 112), 184 | "peekViewResult.fileForeground": fg1, 185 | "peekViewResult.selectionBackground": withAlpha(blue1, 32), 186 | "peekViewResult.selectionForeground": fg1, 187 | "peekViewResult.lineForeground": fg1, 188 | "peekViewResult.matchHighlightBackground": bg2, 189 | "peekViewTitle.background": withAlpha(bg1, 112), 190 | "peekViewTitleDescription.foreground": fg3, 191 | "peekViewTitleLabel.foreground": fg1, 192 | // MERGE CONFLICTS 193 | "merge.currentHeaderBackground": withAlpha(blue1, 64), 194 | "merge.currentContentBackground": withAlpha(blue1, 32), 195 | "merge.incomingHeaderBackground": withAlpha(aqua1, 64), 196 | "merge.incomingContentBackground": withAlpha(aqua1, 32), 197 | "merge.border": transparent, 198 | "editorOverviewRuler.currentContentForeground": blue1, 199 | "editorOverviewRuler.incomingContentForeground": aqua1, 200 | "editorOverviewRuler.commonContentForeground": grey, 201 | // PANELS 202 | "panel.border": bg1, 203 | "panelTitle.activeForeground": fg1, 204 | // STATUS BAR 205 | "statusBar.background": bg0, 206 | "statusBar.border": bg1, 207 | "statusBar.foreground": fg1, 208 | "statusBar.debuggingBackground": orange2, 209 | "statusBar.debuggingForeground": bg0, 210 | "statusBar.debuggingBorder": transparent, 211 | "statusBar.noFolderBackground": bg0, 212 | "statusBar.noFolderBorder": transparent, 213 | // INTEGRATED TERMINAL 214 | "terminal.ansiBlack": bg1, 215 | "terminal.ansiBrightBlack": grey, 216 | "terminal.ansiRed": red1, 217 | "terminal.ansiBrightRed": red2, 218 | "terminal.ansiGreen": green1, 219 | "terminal.ansiBrightGreen": green2, 220 | "terminal.ansiYellow": yellow1, 221 | "terminal.ansiBrightYellow": yellow2, 222 | "terminal.ansiBlue": blue1, 223 | "terminal.ansiBrightBlue": blue2, 224 | "terminal.ansiMagenta": purple1, 225 | "terminal.ansiBrightMagenta": purple2, 226 | "terminal.ansiCyan": aqua1, 227 | "terminal.ansiBrightCyan": aqua2, 228 | "terminal.ansiWhite": fg4, 229 | "terminal.ansiBrightWhite": fg1, 230 | "terminal.foreground": fg1, 231 | "terminal.background": bg0, 232 | // TITLE BAR macOS (not tested) 233 | "titleBar.activeBackground": bg0, 234 | "titleBar.activeForeground": fg1, 235 | "titleBar.inactiveBackground": bg0, 236 | // GIT COLORS 237 | "gitDecoration.modifiedResourceForeground": yellow1, 238 | "gitDecoration.deletedResourceForeground": red1, 239 | "gitDecoration.untrackedResourceForeground": green1, 240 | "gitDecoration.ignoredResourceForeground": bg4, 241 | "gitDecoration.conflictingResourceForeground": purple1, 242 | "scmGraph.historyItemHoverLabelForeground": white, 243 | "scmGraph.historyItemHoverDefaultLabelForeground": white, 244 | // MENU BAR 245 | "menu.border": bg1, 246 | "menu.separatorBackground": bg1, 247 | // EXTENSIONS 248 | "extensionButton.prominentBackground": withAlpha(green2, 128), 249 | "extensionButton.prominentHoverBackground": withAlpha(green2, 48), 250 | // OTHERS 251 | "textLink.foreground": blue2, 252 | "textLink.activeForeground": blue1, 253 | "debugToolBar.background": bg0, 254 | "editorGhostText.background": withAlpha(bg3, 96), 255 | }; 256 | }; 257 | -------------------------------------------------------------------------------- /src/colors/extensions/gitlens.ts: -------------------------------------------------------------------------------- 1 | import { ColorScheme, ColorContrast, allColors, withAlpha } from "../../shared"; 2 | 3 | export const getGitLensColors = ( 4 | scheme: ColorScheme, 5 | contrast: ColorContrast, 6 | ) => { 7 | const colors = allColors[scheme]; 8 | const { 9 | bg1, 10 | bg4, 11 | grey, 12 | fg1, 13 | red1, 14 | red2, 15 | green1, 16 | green2, 17 | yellow1, 18 | yellow2, 19 | blue1, 20 | blue2, 21 | purple1, 22 | purple2, 23 | aqua1, 24 | aqua2, 25 | orange1, 26 | orange2, 27 | } = colors; 28 | const bg0 = colors[`bg0_${contrast}`]; 29 | 30 | return { 31 | "gitlens.closedAutolinkedIssueIconColor": purple1, 32 | "gitlens.closedPullRequestIconColor": red1, 33 | "gitDecoration.addedResourceForeground": fg1, 34 | "gitlens.decorations.branchAheadForegroundColor": green1, 35 | "gitlens.decorations.branchBehindForegroundColor": orange1, 36 | "gitlens.decorations.branchDivergedForegroundColor": yellow1, 37 | "gitlens.decorations.branchMissingUpstreamForegroundColor": red1, 38 | "gitlens.decorations.statusMergingOrRebasingConflictForegroundColor": red1, 39 | "gitlens.decorations.statusMergingOrRebasingForegroundColor": yellow1, 40 | "gitlens.decorations.workspaceCurrentForegroundColor": green1, 41 | "gitlens.decorations.workspaceRepoMissingForegroundColor": bg4, 42 | "gitlens.decorations.workspaceRepoOpenForegroundColor": green1, 43 | "gitlens.decorations.worktreeHasUncommittedChangesForegroundColor": grey, 44 | "gitlens.decorations.worktreeMissingForegroundColor": red1, 45 | "gitlens.graphChangesColumnAddedColor": green1, 46 | "gitlens.graphChangesColumnDeletedColor": red1, 47 | "gitlens.graphLane1Color": blue2, 48 | "gitlens.graphLane2Color": blue1, 49 | "gitlens.graphLane3Color": purple2, 50 | "gitlens.graphLane4Color": purple1, 51 | "gitlens.graphLane5Color": aqua2, 52 | "gitlens.graphLane6Color": aqua1, 53 | "gitlens.graphLane7Color": yellow2, 54 | "gitlens.graphLane8Color": yellow1, 55 | "gitlens.graphLane9Color": green2, 56 | "gitlens.graphLane10Color": green1, 57 | "gitlens.graphMinimapMarkerHeadColor": green1, 58 | "gitlens.graphMinimapMarkerHighlightsColor": green2, 59 | "gitlens.graphMinimapMarkerLocalBranchesColor": blue2, 60 | "gitlens.graphMinimapMarkerPullRequestsColor": orange2, 61 | "gitlens.graphMinimapMarkerRemoteBranchesColor": blue1, 62 | "gitlens.graphMinimapMarkerStashesColor": purple1, 63 | "gitlens.graphMinimapMarkerTagsColor": bg4, 64 | "gitlens.graphMinimapMarkerUpstreamColor": aqua1, 65 | "gitlens.graphScrollMarkerHeadColor": green2, 66 | "gitlens.graphScrollMarkerHighlightsColor": yellow1, 67 | "gitlens.graphScrollMarkerLocalBranchesColor": blue2, 68 | "gitlens.graphScrollMarkerPullRequestsColor": orange2, 69 | "gitlens.graphScrollMarkerRemoteBranchesColor": blue1, 70 | "gitlens.graphScrollMarkerStashesColor": purple1, 71 | "gitlens.graphScrollMarkerTagsColor": bg4, 72 | "gitlens.graphScrollMarkerUpstreamColor": aqua2, 73 | "gitlens.gutterBackgroundColor": bg1, 74 | "gitlens.gutterForegroundColor": fg1, 75 | "gitlens.gutterUncommittedForegroundColor": blue1, 76 | "gitlens.launchpadIndicatorAttentionColor": yellow2, 77 | "gitlens.launchpadIndicatorAttentionHoverColor": yellow1, 78 | "gitlens.launchpadIndicatorBlockedColor": red2, 79 | "gitlens.launchpadIndicatorBlockedHoverColor": red1, 80 | "gitlens.launchpadIndicatorMergeableColor": green2, 81 | "gitlens.launchpadIndicatorMergeableHoverColor": green1, 82 | "gitlens.lineHighlightBackgroundColor": bg1, 83 | "gitlens.lineHighlightOverviewRulerColor": blue1, 84 | "gitlens.mergedPullRequestIconColor": purple1, 85 | "gitlens.openAutolinkedIssueIconColor": green1, 86 | "gitlens.openPullRequestIconColor": green1, 87 | "gitlens.trailingLineBackgroundColor": withAlpha(bg0, 160), 88 | "gitlens.trailingLineForegroundColor": withAlpha(grey, 160), 89 | "gitlens.unpublishedChangesIconColor": green1, 90 | "gitlens.unpublishedCommitIconColor": green1, 91 | "gitlens.unpulledChangesIconColor": orange2, 92 | }; 93 | }; 94 | -------------------------------------------------------------------------------- /src/colors/extensions/jupyter-notebook.ts: -------------------------------------------------------------------------------- 1 | import { ColorScheme, allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getJupyterNotebookColors: Getter = (scheme: ColorScheme) => { 5 | const colors = allColors[scheme]; 6 | const { bg1, fg4, bg2 } = colors; 7 | 8 | return { 9 | "notebook.cellEditorBackground": bg1, 10 | "notebook.focusedCellBorder": fg4, 11 | "notebook.cellBorderColor": bg2, 12 | "notebook.focusedEditorBorder": bg2, 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /src/colors/types.ts: -------------------------------------------------------------------------------- 1 | import { ColorContrast, ColorScheme } from "../shared"; 2 | 3 | export type Getter = ( 4 | scheme: ColorScheme, 5 | contrast: ColorContrast, 6 | ) => Record; 7 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { promises } from "node:fs"; 2 | import { ColorContrast, ColorScheme } from "./shared"; 3 | import { getPythonColors } from "./token-colors/languages/python"; 4 | import { getShellColors } from "./token-colors/languages/shell"; 5 | import { getCColors } from "./token-colors/languages/c"; 6 | import { getMakefileColors } from "./token-colors/languages/makefile"; 7 | import { getJavaColors } from "./token-colors/languages/java"; 8 | import { getLispColors } from "./token-colors/languages/lisp"; 9 | import { getMarkUpDownColors } from "./token-colors/languages/mark-up-down"; 10 | import { getJsonColors } from "./token-colors/languages/json"; 11 | import { getCSSColors } from "./token-colors/languages/css"; 12 | import { getXMLHTMLColors } from "./token-colors/languages/xml-html"; 13 | import { getJSTSColors } from "./token-colors/languages/js-ts"; 14 | import { getGolangColors } from "./token-colors/languages/golang"; 15 | import { getCucumberColors } from "./token-colors/languages/cucumber"; 16 | import { getReasonMLColors } from "./token-colors/languages/reason-ml"; 17 | import { getPowershellColors } from "./token-colors/languages/powershell"; 18 | import { getLatexColors } from "./token-colors/languages/latex"; 19 | import { getBaseTokenColors } from "./token-colors/base"; 20 | import { getSemanticColors } from "./semantic-colors"; 21 | import { getBaseColors } from "./colors/base"; 22 | import { getJupyterNotebookColors } from "./colors/extensions/jupyter-notebook"; 23 | import { getGitLensColors } from "./colors/extensions/gitlens"; 24 | 25 | const variants: Array<[ColorScheme, ColorContrast]> = [ 26 | ["dark", "hard"], 27 | ["dark", "medium"], 28 | ["dark", "soft"], 29 | ["light", "hard"], 30 | ["light", "medium"], 31 | ["light", "soft"], 32 | ]; 33 | 34 | const getName = (scheme: ColorScheme, contrast: ColorContrast) => 35 | `Gruvbox ${scheme[0].toUpperCase()}${scheme.slice(1)} ${contrast[0].toUpperCase()}${contrast.slice(1)}`; 36 | 37 | const generateJson = (scheme: ColorScheme, contrast: ColorContrast) => { 38 | return { 39 | $schema: "vscode://schemas/color-theme", 40 | name: getName(scheme, contrast), 41 | type: scheme, 42 | semanticHighlighting: true, 43 | tokenColors: [ 44 | ...getBaseTokenColors(scheme, contrast), 45 | ...getPythonColors(scheme, contrast), 46 | ...getShellColors(scheme, contrast), 47 | ...getCColors(scheme, contrast), 48 | ...getMakefileColors(scheme, contrast), 49 | ...getJavaColors(scheme, contrast), 50 | ...getLispColors(scheme, contrast), 51 | ...getMarkUpDownColors(scheme, contrast), 52 | ...getJsonColors(scheme, contrast), 53 | ...getCSSColors(scheme, contrast), 54 | ...getXMLHTMLColors(scheme, contrast), 55 | ...getJSTSColors(scheme, contrast), 56 | ...getGolangColors(scheme, contrast), 57 | ...getCucumberColors(scheme, contrast), 58 | ...getReasonMLColors(scheme, contrast), 59 | ...getPowershellColors(scheme, contrast), 60 | ...getLatexColors(scheme, contrast), 61 | ], 62 | colors: { 63 | ...getBaseColors(scheme, contrast), 64 | ...getJupyterNotebookColors(scheme, contrast), 65 | ...getGitLensColors(scheme, contrast), 66 | }, 67 | semanticTokenColors: getSemanticColors(scheme), 68 | }; 69 | }; 70 | 71 | const run = async () => { 72 | await Promise.all( 73 | variants.map(async ([scheme, contrast]) => 74 | promises.writeFile( 75 | `./themes/gruvbox-${scheme}-${contrast}.json`, 76 | JSON.stringify(generateJson(scheme, contrast), undefined, "\t"), 77 | ), 78 | ), 79 | ); 80 | console.log("themes generated\n"); 81 | }; 82 | 83 | run(); 84 | -------------------------------------------------------------------------------- /src/semantic-colors.ts: -------------------------------------------------------------------------------- 1 | import { allColors, ColorScheme } from "./shared"; 2 | 3 | export const getSemanticColors = (scheme: ColorScheme) => { 4 | const { orange2, blue2, aqua2, purple2, fg1 } = allColors[scheme]; 5 | return { 6 | "constant.builtin": purple2, 7 | property: blue2, 8 | "property:python": fg1, 9 | parameter: blue2, 10 | variable: fg1, 11 | function: aqua2, 12 | "function.builtin": orange2, 13 | method: aqua2, 14 | component: orange2, 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /src/shared.ts: -------------------------------------------------------------------------------- 1 | export type ColorKey = 2 | | "bg0_hard" 3 | | "bg0_medium" 4 | | "bg0_soft" 5 | | "bg1" 6 | | "bg2" 7 | | "bg3" 8 | | "bg4" 9 | | "grey" 10 | | "fg0" 11 | | "fg1" 12 | | "fg2" 13 | | "fg3" 14 | | "fg4" 15 | | "red1" 16 | | "red2" 17 | | "green1" 18 | | "green2" 19 | | "yellow1" 20 | | "yellow2" 21 | | "blue1" 22 | | "blue2" 23 | | "purple1" 24 | | "purple2" 25 | | "aqua1" 26 | | "aqua2" 27 | | "orange1" 28 | | "orange2" 29 | | "transparent" 30 | | "white"; 31 | export type ColorScheme = "dark" | "light"; 32 | export type ColorContrast = "hard" | "medium" | "soft"; 33 | 34 | export const allColors: Record> = { 35 | dark: { 36 | bg0_hard: "#1d2021", 37 | bg0_medium: "#282828", 38 | bg0_soft: "#32302f", 39 | bg1: "#3c3836", 40 | bg2: "#504945", 41 | bg3: "#665c54", 42 | bg4: "#7c6f64", 43 | grey: "#928374", 44 | fg0: "#fbf1c7", 45 | fg1: "#ebdbb2", 46 | fg2: "#d5c4a1", 47 | fg3: "#bdae93", 48 | fg4: "#a89984", 49 | red1: "#cc241d", 50 | red2: "#fb4934", 51 | green1: "#98971a", 52 | green2: "#b8bb26", 53 | yellow1: "#d79921", 54 | yellow2: "#fabd2f", 55 | blue1: "#458588", 56 | blue2: "#83a598", 57 | purple1: "#b16286", 58 | purple2: "#d3869b", 59 | aqua1: "#689d6a", 60 | aqua2: "#8ec07c", 61 | orange1: "#d65d0e", 62 | orange2: "#fe8019", 63 | transparent: "#0000", 64 | white: "#ebdbb2", 65 | }, 66 | light: { 67 | bg0_hard: "#f9f5d7", 68 | bg0_medium: "#fbf1c7", 69 | bg0_soft: "#f2e5bc", 70 | bg1: "#ebdbb2", 71 | bg2: "#d5c4a1", 72 | bg3: "#bdae93", 73 | bg4: "#a89984", 74 | grey: "#928374", 75 | fg0: "#282828", 76 | fg1: "#3c3836", 77 | fg2: "#504945", 78 | fg3: "#665c54", 79 | fg4: "#7c6f64", 80 | red1: "#cc241d", 81 | red2: "#9d0006", 82 | green1: "#98971a", 83 | green2: "#79740e", 84 | yellow1: "#d79921", 85 | yellow2: "#b57614", 86 | blue1: "#458588", 87 | blue2: "#076678", 88 | purple1: "#b16286", 89 | purple2: "#8f3f71", 90 | aqua1: "#689d6a", 91 | aqua2: "#427b58", 92 | orange1: "#d65d0e", 93 | orange2: "#af3a03", 94 | transparent: "#0000", 95 | white: "#ebdbb2", 96 | }, 97 | }; 98 | 99 | // https://stackoverflow.com/a/39495173 100 | type Enumerate< 101 | N extends number, 102 | Acc extends number[] = [], 103 | > = Acc["length"] extends N 104 | ? Acc[number] 105 | : Enumerate; 106 | type IntRange = Exclude< 107 | Enumerate, 108 | Enumerate 109 | >; 110 | 111 | export const withAlpha = (color: `#${string}`, alpha: IntRange<0, 256>) => { 112 | return `${color}${alpha.toString(16).padStart(2, "0")}`; 113 | }; 114 | -------------------------------------------------------------------------------- /src/token-colors/base.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../shared"; 2 | import { Getter } from "./types"; 3 | 4 | export const getBaseTokenColors: Getter = (scheme) => { 5 | const { 6 | fg1, 7 | fg2, 8 | fg4, 9 | red1, 10 | red2, 11 | orange2, 12 | yellow1, 13 | yellow2, 14 | green2, 15 | aqua1, 16 | aqua2, 17 | blue1, 18 | blue2, 19 | purple1, 20 | purple2, 21 | grey, 22 | } = allColors[scheme]; 23 | return [ 24 | { 25 | settings: { 26 | foreground: fg1, 27 | }, 28 | }, 29 | { 30 | scope: "emphasis", 31 | settings: { 32 | fontStyle: "italic", 33 | }, 34 | }, 35 | { 36 | scope: "strong", 37 | settings: { 38 | fontStyle: "bold", 39 | }, 40 | }, 41 | { 42 | scope: "header", 43 | settings: { 44 | foreground: blue1, 45 | }, 46 | }, 47 | { 48 | scope: ["comment", "punctuation.definition.comment"], 49 | settings: { 50 | foreground: grey, 51 | fontStyle: "italic", 52 | }, 53 | }, 54 | { 55 | scope: ["constant", "support.constant", "variable.arguments"], 56 | settings: { 57 | foreground: purple2, 58 | }, 59 | }, 60 | { 61 | scope: "constant.rgb-value", 62 | settings: { 63 | foreground: fg1, 64 | }, 65 | }, 66 | { 67 | scope: "entity.name.selector", 68 | settings: { 69 | foreground: aqua2, 70 | }, 71 | }, 72 | { 73 | scope: "entity.other.attribute-name", 74 | settings: { 75 | foreground: yellow2, 76 | }, 77 | }, 78 | { 79 | scope: ["entity.name.tag", "punctuation.tag"], 80 | settings: { 81 | foreground: aqua2, 82 | }, 83 | }, 84 | { 85 | scope: ["invalid", "invalid.illegal"], 86 | settings: { 87 | foreground: red1, 88 | }, 89 | }, 90 | { 91 | scope: "invalid.deprecated", 92 | settings: { 93 | foreground: purple1, 94 | }, 95 | }, 96 | { 97 | scope: "meta.selector", 98 | settings: { 99 | foreground: aqua2, 100 | }, 101 | }, 102 | { 103 | scope: "meta.preprocessor", 104 | settings: { 105 | foreground: orange2, 106 | }, 107 | }, 108 | { 109 | scope: "meta.preprocessor.string", 110 | settings: { 111 | foreground: green2, 112 | }, 113 | }, 114 | { 115 | scope: "meta.preprocessor.numeric", 116 | settings: { 117 | foreground: green2, 118 | }, 119 | }, 120 | { 121 | scope: "meta.header.diff", 122 | settings: { 123 | foreground: orange2, 124 | }, 125 | }, 126 | { 127 | scope: "storage", 128 | settings: { 129 | foreground: red2, 130 | }, 131 | }, 132 | { 133 | scope: ["storage.type", "storage.modifier"], 134 | settings: { 135 | foreground: orange2, 136 | }, 137 | }, 138 | { 139 | scope: "string", 140 | settings: { 141 | foreground: green2, 142 | }, 143 | }, 144 | { 145 | scope: "string.tag", 146 | settings: { 147 | foreground: green2, 148 | }, 149 | }, 150 | { 151 | scope: "string.value", 152 | settings: { 153 | foreground: green2, 154 | }, 155 | }, 156 | { 157 | scope: "string.regexp", 158 | settings: { 159 | foreground: orange2, 160 | }, 161 | }, 162 | { 163 | scope: "string.escape", 164 | settings: { 165 | foreground: red2, 166 | }, 167 | }, 168 | { 169 | scope: "string.quasi", 170 | settings: { 171 | foreground: aqua2, 172 | }, 173 | }, 174 | { 175 | scope: "string.entity", 176 | settings: { 177 | foreground: green2, 178 | }, 179 | }, 180 | { 181 | scope: "object", 182 | settings: { 183 | foreground: fg1, 184 | }, 185 | }, 186 | { 187 | scope: "module.node", 188 | settings: { 189 | foreground: blue2, 190 | }, 191 | }, 192 | { 193 | scope: "support.type.property-name", 194 | settings: { 195 | foreground: aqua1, 196 | }, 197 | }, 198 | { 199 | scope: "keyword", 200 | settings: { 201 | foreground: red2, 202 | }, 203 | }, 204 | { 205 | scope: "keyword.control", 206 | settings: { 207 | foreground: red2, 208 | }, 209 | }, 210 | { 211 | scope: "keyword.control.module", 212 | settings: { 213 | foreground: aqua2, 214 | }, 215 | }, 216 | { 217 | scope: "keyword.control.less", 218 | settings: { 219 | foreground: yellow1, 220 | }, 221 | }, 222 | { 223 | scope: "keyword.operator", 224 | settings: { 225 | foreground: aqua2, 226 | }, 227 | }, 228 | { 229 | scope: "keyword.operator.new", 230 | settings: { 231 | foreground: orange2, 232 | }, 233 | }, 234 | { 235 | scope: "keyword.other.unit", 236 | settings: { 237 | foreground: green2, 238 | }, 239 | }, 240 | { 241 | scope: "metatag.php", 242 | settings: { 243 | foreground: orange2, 244 | }, 245 | }, 246 | { 247 | scope: "support.function.git-rebase", 248 | settings: { 249 | foreground: aqua1, 250 | }, 251 | }, 252 | { 253 | scope: "constant.sha.git-rebase", 254 | settings: { 255 | foreground: green2, 256 | }, 257 | }, 258 | { 259 | name: "Types declaration and references", 260 | scope: [ 261 | "meta.type.name", 262 | "meta.return.type", 263 | "meta.return-type", 264 | "meta.cast", 265 | "meta.type.annotation", 266 | "support.type", 267 | "storage.type.cs", 268 | "variable.class", 269 | ], 270 | settings: { 271 | foreground: yellow2, 272 | }, 273 | }, 274 | { 275 | scope: ["variable.this", "support.variable"], 276 | settings: { 277 | foreground: purple2, 278 | }, 279 | }, 280 | { 281 | scope: [ 282 | "entity.name", 283 | "entity.static", 284 | "entity.name.class.static.function", 285 | "entity.name.function", 286 | "entity.name.class", 287 | "entity.name.type", 288 | ], 289 | settings: { 290 | foreground: yellow2, 291 | }, 292 | }, 293 | { 294 | name: "Function declarations", 295 | scope: ["entity.function", "entity.name.function.static"], 296 | settings: { 297 | foreground: aqua2, 298 | }, 299 | }, 300 | { 301 | scope: "entity.name.function.function-call", 302 | settings: { 303 | foreground: aqua2, 304 | }, 305 | }, 306 | { 307 | scope: "support.function.builtin", 308 | settings: { 309 | foreground: orange2, 310 | }, 311 | }, 312 | { 313 | scope: [ 314 | "entity.name.method", 315 | "entity.name.method.function-call", 316 | "entity.name.static.function-call", 317 | ], 318 | settings: { 319 | foreground: aqua1, 320 | }, 321 | }, 322 | { 323 | scope: "brace", 324 | settings: { 325 | foreground: fg2, 326 | }, 327 | }, 328 | { 329 | name: "variables", 330 | scope: [ 331 | "meta.parameter.type.variable", 332 | "variable.parameter", 333 | "variable.name", 334 | "variable.other", 335 | "variable", 336 | "string.constant.other.placeholder", 337 | ], 338 | settings: { 339 | foreground: blue2, 340 | }, 341 | }, 342 | { 343 | scope: "prototype", 344 | settings: { 345 | foreground: purple2, 346 | }, 347 | }, 348 | { 349 | scope: ["punctuation"], 350 | settings: { 351 | foreground: fg4, 352 | }, 353 | }, 354 | { 355 | scope: "punctuation.quoted", 356 | settings: { 357 | foreground: fg1, 358 | }, 359 | }, 360 | { 361 | scope: "punctuation.quasi", 362 | settings: { 363 | foreground: red2, 364 | }, 365 | }, 366 | { 367 | name: "URL", 368 | scope: ["*url*", "*link*", "*uri*"], 369 | settings: { 370 | fontStyle: "underline", 371 | }, 372 | }, 373 | ]; 374 | }; 375 | -------------------------------------------------------------------------------- /src/token-colors/languages/c.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getCColors: Getter = (scheme) => { 5 | const { aqua2, yellow2, green2, purple2 } = allColors[scheme]; 6 | return [ 7 | // C C++ ---------------------------------------- 8 | { 9 | scope: "keyword.control.directive", 10 | settings: { 11 | foreground: aqua2, 12 | }, 13 | }, 14 | { 15 | scope: "support.function.C99", 16 | settings: { 17 | foreground: yellow2, 18 | }, 19 | }, 20 | // C# ---------------------------------------- 21 | { 22 | name: "C# functions & namespace", 23 | scope: [ 24 | "meta.function.cs", 25 | "entity.name.function.cs", 26 | "entity.name.type.namespace.cs", 27 | ], 28 | settings: { 29 | foreground: green2, 30 | }, 31 | }, 32 | { 33 | name: "C# Variables", 34 | scope: [ 35 | "keyword.other.using.cs", 36 | "entity.name.variable.field.cs", 37 | "entity.name.variable.local.cs", 38 | "variable.other.readwrite.cs", 39 | ], 40 | settings: { 41 | foreground: aqua2, 42 | }, 43 | }, 44 | { 45 | name: "C# This", 46 | scope: ["keyword.other.this.cs", "keyword.other.base.cs"], 47 | settings: { 48 | foreground: purple2, 49 | }, 50 | }, 51 | ]; 52 | }; 53 | -------------------------------------------------------------------------------- /src/token-colors/languages/css.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getCSSColors: Getter = (scheme) => { 5 | const { orange2, fg1, green2, red2, orange1 } = allColors[scheme]; 6 | return [ 7 | { 8 | scope: "entity.other.attribute-name.css", 9 | settings: { 10 | foreground: orange2, 11 | }, 12 | }, 13 | { 14 | scope: "source.css meta.selector", 15 | settings: { 16 | foreground: fg1, 17 | }, 18 | }, 19 | { 20 | scope: "support.type.property-name.css", 21 | settings: { 22 | foreground: orange2, 23 | }, 24 | }, 25 | { 26 | scope: "entity.other.attribute-name.class", 27 | settings: { 28 | foreground: green2, 29 | }, 30 | }, 31 | { 32 | scope: [ 33 | "source.css support.function.transform", 34 | "source.css support.function.timing-function", 35 | "source.css support.function.misc", 36 | ], 37 | settings: { 38 | foreground: red2, 39 | }, 40 | }, 41 | { 42 | name: "CSS property value", 43 | scope: [ 44 | "support.property-value", 45 | "constant.rgb-value", 46 | "support.property-value.scss", 47 | "constant.rgb-value.scss", 48 | ], 49 | settings: { 50 | foreground: orange1, 51 | }, 52 | }, 53 | { 54 | scope: ["entity.name.tag.css"], 55 | settings: { 56 | fontStyle: "", 57 | }, 58 | }, 59 | ]; 60 | }; 61 | -------------------------------------------------------------------------------- /src/token-colors/languages/cucumber.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getCucumberColors: Getter = (scheme) => { 5 | const { blue2 } = allColors[scheme]; 6 | return [ 7 | { 8 | scope: ["keyword.control.cucumber.table"], 9 | settings: { 10 | foreground: blue2, 11 | }, 12 | }, 13 | ]; 14 | }; 15 | -------------------------------------------------------------------------------- /src/token-colors/languages/golang.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getGolangColors: Getter = (scheme) => { 5 | const { fg1, yellow2, green2, aqua2, blue2, purple2 } = allColors[scheme]; 6 | return [ 7 | { 8 | scope: ["source.go storage.type"], 9 | settings: { 10 | foreground: yellow2, 11 | }, 12 | }, 13 | { 14 | scope: ["source.go entity.name.import"], 15 | settings: { 16 | foreground: green2, 17 | }, 18 | }, 19 | { 20 | scope: ["source.go keyword.package", "source.go keyword.import"], 21 | settings: { 22 | foreground: aqua2, 23 | }, 24 | }, 25 | { 26 | scope: ["source.go keyword.interface", "source.go keyword.struct"], 27 | settings: { 28 | foreground: blue2, 29 | }, 30 | }, 31 | { 32 | scope: ["source.go entity.name.type"], 33 | settings: { 34 | foreground: fg1, 35 | }, 36 | }, 37 | { 38 | scope: ["source.go entity.name.function"], 39 | settings: { 40 | foreground: purple2, 41 | }, 42 | }, 43 | ]; 44 | }; 45 | -------------------------------------------------------------------------------- /src/token-colors/languages/java.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getJavaColors: Getter = (scheme) => { 5 | const { aqua2, blue2, fg1, green2, yellow2, fg3 } = allColors[scheme]; 6 | return [ 7 | { 8 | name: "coloring of the Java import and package identifiers", 9 | scope: ["storage.modifier.import.java", "storage.modifier.package.java"], 10 | settings: { 11 | foreground: fg3, 12 | }, 13 | }, 14 | { 15 | scope: ["keyword.other.import.java", "keyword.other.package.java"], 16 | settings: { 17 | foreground: aqua2, 18 | }, 19 | }, 20 | { 21 | scope: "storage.type.java", 22 | settings: { 23 | foreground: yellow2, 24 | }, 25 | }, 26 | { 27 | scope: "storage.type.annotation", 28 | settings: { 29 | foreground: blue2, 30 | fontStyle: "bold", 31 | }, 32 | }, 33 | { 34 | scope: "keyword.other.documentation.javadoc", 35 | settings: { 36 | foreground: aqua2, 37 | }, 38 | }, 39 | { 40 | scope: "comment.block.javadoc variable.parameter.java", 41 | settings: { 42 | foreground: green2, 43 | fontStyle: "bold", 44 | }, 45 | }, 46 | { 47 | scope: [ 48 | "source.java variable.other.object", 49 | "source.java variable.other.definition.java", 50 | ], 51 | settings: { 52 | foreground: fg1, 53 | }, 54 | }, 55 | ]; 56 | }; 57 | -------------------------------------------------------------------------------- /src/token-colors/languages/js-ts.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getJSTSColors: Getter = (scheme) => { 5 | const { orange2 } = allColors[scheme]; 6 | return [ 7 | // javascript --------------------------------------- 8 | { 9 | scope: ["source.js variable.language"], 10 | settings: { 11 | foreground: orange2, 12 | }, 13 | }, 14 | // typescript --------------------------------------- 15 | { 16 | scope: ["source.ts variable.language"], 17 | settings: { 18 | foreground: orange2, 19 | }, 20 | }, 21 | ]; 22 | }; 23 | -------------------------------------------------------------------------------- /src/token-colors/languages/json.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getJsonColors: Getter = (scheme) => { 5 | const { blue2 } = allColors[scheme]; 6 | return [ 7 | { 8 | scope: "string.quoted.double.json", 9 | settings: { 10 | foreground: blue2, 11 | }, 12 | }, 13 | ]; 14 | }; 15 | -------------------------------------------------------------------------------- /src/token-colors/languages/latex.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getLatexColors: Getter = (scheme) => { 5 | const { aqua2, red2, orange2, purple2 } = allColors[scheme]; 6 | return [ 7 | { 8 | name: "LaTeX functions", 9 | scope: [ 10 | "support.function.be.latex", 11 | "support.function.general.tex", 12 | "support.function.section.latex", 13 | "support.function.textbf.latex", 14 | "support.function.textit.latex", 15 | "support.function.texttt.latex", 16 | "support.function.emph.latex", 17 | "support.function.url.latex", 18 | ], 19 | settings: { 20 | foreground: red2, 21 | }, 22 | }, 23 | { 24 | name: "LaTeX text in math environment", 25 | scope: [ 26 | "support.class.math.block.tex", 27 | "support.class.math.block.environment.latex", 28 | ], 29 | settings: { 30 | foreground: orange2, 31 | }, 32 | }, 33 | { 34 | name: "LaTeX preamble", 35 | scope: [ 36 | "keyword.control.preamble.latex", 37 | "keyword.control.include.latex", 38 | ], 39 | settings: { 40 | foreground: purple2, 41 | }, 42 | }, 43 | { 44 | name: "LaTeX packages", 45 | scope: ["support.class.latex"], 46 | settings: { 47 | foreground: aqua2, 48 | }, 49 | }, 50 | ]; 51 | }; 52 | -------------------------------------------------------------------------------- /src/token-colors/languages/lisp.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getLispColors: Getter = (scheme) => { 5 | const { yellow2 } = allColors[scheme]; 6 | return [ 7 | { 8 | name: "Lisp optional function parameters", 9 | scope: "meta.function-parameters.lisp", 10 | settings: { 11 | foreground: yellow2, 12 | }, 13 | }, 14 | ]; 15 | }; 16 | -------------------------------------------------------------------------------- /src/token-colors/languages/makefile.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getMakefileColors: Getter = (scheme) => { 5 | const { yellow2, green2 } = allColors[scheme]; 6 | return [ 7 | { 8 | scope: "meta.scope.prerequisites", 9 | settings: { 10 | foreground: yellow2, 11 | }, 12 | }, 13 | { 14 | scope: "entity.name.function.target", 15 | settings: { 16 | foreground: green2, 17 | fontStyle: "bold", 18 | }, 19 | }, 20 | ]; 21 | }; 22 | -------------------------------------------------------------------------------- /src/token-colors/languages/mark-up-down.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getMarkUpDownColors: Getter = (scheme) => { 5 | const { orange1, orange2, green1, green2, blue2, aqua2, purple2, grey } = 6 | allColors[scheme]; 7 | return [ 8 | { 9 | scope: "markup.underline", 10 | settings: { 11 | fontStyle: "underline", 12 | }, 13 | }, 14 | { 15 | scope: "string.other.link.title.markdown", 16 | settings: { 17 | foreground: grey, 18 | fontStyle: "underline", 19 | }, 20 | }, 21 | { 22 | scope: "markup.underline.link", 23 | settings: { 24 | foreground: purple2, 25 | }, 26 | }, 27 | { 28 | scope: "markup.bold", 29 | settings: { 30 | fontStyle: "bold", 31 | foreground: orange2, 32 | }, 33 | }, 34 | { 35 | scope: "markup.heading", 36 | settings: { 37 | fontStyle: "bold", 38 | foreground: orange2, 39 | }, 40 | }, 41 | { 42 | scope: "markup.italic", 43 | settings: { 44 | fontStyle: "italic", 45 | }, 46 | }, 47 | { 48 | scope: "markup.inserted", 49 | settings: { 50 | foreground: green2, 51 | }, 52 | }, 53 | { 54 | scope: "markup.deleted", 55 | settings: { 56 | foreground: orange1, 57 | }, 58 | }, 59 | { 60 | scope: "markup.changed", 61 | settings: { 62 | foreground: orange2, 63 | }, 64 | }, 65 | { 66 | scope: "markup.punctuation.quote.beginning", 67 | settings: { 68 | foreground: green1, 69 | }, 70 | }, 71 | { 72 | scope: "markup.punctuation.list.beginning", 73 | settings: { 74 | foreground: blue2, 75 | }, 76 | }, 77 | { 78 | scope: ["markup.inline.raw", "markup.fenced_code.block"], 79 | settings: { 80 | foreground: aqua2, 81 | }, 82 | }, 83 | ]; 84 | }; 85 | -------------------------------------------------------------------------------- /src/token-colors/languages/powershell.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getPowershellColors: Getter = (scheme) => { 5 | const { orange2, yellow2, fg3 } = allColors[scheme]; 6 | return [ 7 | { 8 | name: "Powershell member", 9 | scope: ["source.powershell variable.other.member.powershell"], 10 | settings: { 11 | foreground: orange2, 12 | }, 13 | }, 14 | { 15 | name: "Powershell function", 16 | scope: ["source.powershell support.function.powershell"], 17 | settings: { 18 | foreground: yellow2, 19 | }, 20 | }, 21 | { 22 | name: "Powershell function attribute", 23 | scope: ["source.powershell support.function.attribute.powershell"], 24 | settings: { 25 | foreground: fg3, 26 | }, 27 | }, 28 | { 29 | name: "Powershell hashtable member", 30 | scope: [ 31 | "source.powershell meta.hashtable.assignment.powershell variable.other.readwrite.powershell", 32 | ], 33 | settings: { 34 | foreground: orange2, 35 | }, 36 | }, 37 | ]; 38 | }; 39 | -------------------------------------------------------------------------------- /src/token-colors/languages/python.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getPythonColors: Getter = (scheme) => { 5 | const { aqua2, red2, blue2, fg2, yellow2 } = allColors[scheme]; 6 | return [ 7 | { 8 | name: "Python function", 9 | scope: ["meta.function.python", "entity.name.function.python"], 10 | settings: { 11 | foreground: aqua2, 12 | }, 13 | }, 14 | { 15 | name: "Python Function and Class definition keywords", 16 | scope: [ 17 | "storage.type.function.python", 18 | "storage.modifier.declaration", 19 | "storage.type.class.python", 20 | "storage.type.string.python", 21 | ], 22 | settings: { 23 | foreground: red2, 24 | }, 25 | }, 26 | { 27 | name: "Async keyword", 28 | scope: ["storage.type.function.async.python"], 29 | settings: { 30 | foreground: red2, 31 | }, 32 | }, 33 | { 34 | name: "Python Function Call", 35 | scope: "meta.function-call.generic", 36 | settings: { 37 | foreground: blue2, 38 | }, 39 | }, 40 | { 41 | name: "Python Function Arguments", 42 | scope: "meta.function-call.arguments", 43 | settings: { 44 | foreground: fg2, 45 | }, 46 | }, 47 | { 48 | name: "Python Function decorator", 49 | scope: "entity.name.function.decorator", 50 | settings: { 51 | foreground: yellow2, 52 | fontStyle: "bold", 53 | }, 54 | }, 55 | { 56 | name: "Python ALL CAPS", 57 | scope: "constant.other.caps", 58 | settings: { 59 | fontStyle: "bold", 60 | }, 61 | }, 62 | ]; 63 | }; 64 | -------------------------------------------------------------------------------- /src/token-colors/languages/reason-ml.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getReasonMLColors: Getter = (scheme) => { 5 | const { blue2, orange2, green2, aqua2 } = allColors[scheme]; 6 | return [ 7 | { 8 | name: "ReasonML String", 9 | scope: ["source.reason string.double", "source.reason string.regexp"], 10 | settings: { 11 | foreground: green2, 12 | }, 13 | }, 14 | { 15 | name: "ReasonML equals sign", 16 | scope: ["source.reason keyword.control.less"], 17 | settings: { 18 | foreground: aqua2, 19 | }, 20 | }, 21 | { 22 | name: "ReasonML variable", 23 | scope: ["source.reason entity.name.function"], 24 | settings: { 25 | foreground: blue2, 26 | }, 27 | }, 28 | { 29 | name: "ReasonML property", 30 | scope: [ 31 | "source.reason support.property-value", 32 | "source.reason entity.name.filename", 33 | ], 34 | settings: { 35 | foreground: orange2, 36 | }, 37 | }, 38 | ]; 39 | }; 40 | -------------------------------------------------------------------------------- /src/token-colors/languages/shell.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getShellColors: Getter = (scheme) => { 5 | const { red2, orange2, aqua2 } = allColors[scheme]; 6 | return [ 7 | { 8 | scope: "keyword.operator.logical", 9 | settings: { 10 | foreground: red2, 11 | }, 12 | }, 13 | { 14 | scope: "punctuation.definition.logical-expression", 15 | settings: { 16 | foreground: orange2, 17 | }, 18 | }, 19 | { 20 | scope: [ 21 | "string.interpolated.dollar.shell", 22 | "string.interpolated.backtick.shell", 23 | ], 24 | settings: { 25 | foreground: aqua2, 26 | }, 27 | }, 28 | ]; 29 | }; 30 | -------------------------------------------------------------------------------- /src/token-colors/languages/xml-html.ts: -------------------------------------------------------------------------------- 1 | import { allColors } from "../../shared"; 2 | import { Getter } from "../types"; 3 | 4 | export const getXMLHTMLColors: Getter = (scheme) => { 5 | const { aqua2, blue2 } = allColors[scheme]; 6 | return [ 7 | { 8 | scope: ["punctuation.definition.tag"], 9 | settings: { 10 | foreground: blue2, 11 | }, 12 | }, 13 | { 14 | scope: ["text.html entity.name.tag", "text.html punctuation.tag"], 15 | settings: { 16 | foreground: aqua2, 17 | fontStyle: "bold", 18 | }, 19 | }, 20 | ]; 21 | }; 22 | -------------------------------------------------------------------------------- /src/token-colors/types.ts: -------------------------------------------------------------------------------- 1 | import { ColorContrast, ColorScheme } from "../shared"; 2 | 3 | type TokenColor = { 4 | name?: string; 5 | scope?: string | string[]; 6 | settings: { 7 | foreground?: string; 8 | background?: string; 9 | fontStyle?: string; 10 | }; 11 | }; 12 | 13 | export type Getter = ( 14 | scheme: ColorScheme, 15 | contrast: ColorContrast, 16 | ) => TokenColor[]; 17 | -------------------------------------------------------------------------------- /themes/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // Treat files as modules even if it doesn't use import/export 4 | "moduleDetection": "force", 5 | 6 | // Ignore module structure 7 | "module": "Preserve", 8 | 9 | // Allow JSON modules to be imported 10 | "resolveJsonModule": true, 11 | 12 | // Allow JS files to be imported from TS and vice versa 13 | "allowJs": true, 14 | 15 | // Use correct ESM import behavior 16 | "esModuleInterop": true, 17 | 18 | // Disallow features that require cross-file awareness 19 | "isolatedModules": true 20 | } 21 | } 22 | --------------------------------------------------------------------------------