├── .gitignore ├── LICENSE ├── README.md ├── index.less ├── lib └── main.coffee ├── package.json ├── spec ├── coffeescript.coffee ├── csharp.cs ├── css.css ├── gfm.md ├── git.COMMIT_EDITMSG ├── go.go ├── html.html ├── java.java ├── javascript.js ├── json.json ├── less.less ├── php.php ├── python.py ├── ruby.rb ├── sass.scss ├── text.txt ├── todo.txt └── typescript.ts └── styles ├── editor.less ├── languages ├── _base.less ├── _index.less ├── coffee.less ├── csharp.less ├── css.less ├── gfm.less ├── git-commit.less ├── go.less ├── html.less ├── java.less ├── javascript.less ├── json.less ├── less.less ├── php.less ├── python.less ├── ruby.less ├── scss.less ├── text.less ├── todo.less └── typescript.less ├── palette.less ├── settings.less └── syntax-variables.less /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 simurai 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tone 2 | 3 | An Atom __syntax theme__ with customizable colors. 4 | 5 | It __tones down__ less important parts (like punctuation and brackets) and highlights only the __important__ ones. This leads to a more calm color scheme, but still lets you find the stuff you're looking for. 6 | 7 | ![Tone theme](https://cloud.githubusercontent.com/assets/378023/26292529/a9713500-3ef1-11e7-8dae-28a391bbc5d7.png) 8 | 9 | 10 | ## Settings 11 | 12 | You can change the color scheme by going to `Settings > Themes > tone-syntax` Theme (or the cog icon next to the theme picker). There you can customize the colors. Or edit your `config` file directly. 13 | 14 | ![Tone settings](https://cloud.githubusercontent.com/assets/378023/26289237/307eb036-3ed9-11e7-9b53-f6aae56a7fac.png) 15 | 16 | 17 | ## Language support 18 | 19 | Why is the language support somewhat sparse? In order to decide how a language should be highlighted, it's helpful to understand the language. Only then you can get the nuances right. Therefore this theme only supports a language if somebody actively maintains it. 20 | 21 | ### Actively supported languages 22 | 23 | Language | Extension | Maintainer 24 | --- | --- | --- 25 | CSS | `.css` | [@simurai](https://github.com/simurai) 26 | GF Markdown | `.md` | [@simurai](https://github.com/simurai) 27 | Git Commit Message | `.COMMIT_EDITMSG` | [@simurai](https://github.com/simurai) 28 | HTML | `.html` | [@simurai](https://github.com/simurai) 29 | JSON | `.json` | [@simurai](https://github.com/simurai) 30 | Less | `.less` | [@simurai](https://github.com/simurai) 31 | PHP | `.php` | [@mdeboer](https://github.com/mdeboer) 32 | Sass | `.scss` | [@simurai](https://github.com/simurai) 33 | Text | `.txt` | [@simurai](https://github.com/simurai) 34 | Todo | `.txt` | [@simurai](https://github.com/simurai) 35 | 36 | ### Un-maintained languages 37 | 38 | Language | Extension | Maintainer 39 | --- | --- | --- 40 | CoffeeScript | `.coffee` | :wave: Maintainer wanted 41 | C# | `.cs` | :wave: Maintainer wanted 42 | Go | `.go` | :wave: Maintainer wanted 43 | Java | `.java` | :wave: Maintainer wanted 44 | JavaScript | `.js` | :wave: Maintainer wanted 45 | Python | `.py` | :wave: Maintainer wanted 46 | Ruby | `.rb` | :wave: Maintainer wanted 47 | Typescript | `.ts` | :wave: Maintainer wanted 48 | ??? | ??? | :wave: Maintainer wanted 49 | 50 | 51 | ## Contribute 52 | 53 | Want to contribute? Awesome! Here the steps to add syntax highlighting for a specific language: 54 | 55 | 1. Add an example file to `spec/`. Doesn't have to be complete, just something to test the highlighting. 56 | 2. Add a Less file with the styling to `styles/languages/`. 57 | 3. Add an import to that Less file in `styles/languages/_index.less`. 58 | 4. Add yourself as the maintainer to this `README.md`. 59 | 5. Make a PR. :tada: 60 | 61 | > Note: Since there are hundreds (thousands?) of languages out there, less commonly used languages might not get accepted. :bow: 62 | -------------------------------------------------------------------------------- /index.less: -------------------------------------------------------------------------------- 1 | 2 | // Tone syntax theme 3 | 4 | @import (reference) "styles/syntax-variables"; 5 | @import "styles/settings"; 6 | @import 'styles/editor'; 7 | @import 'styles/palette'; 8 | @import 'styles/languages/_index'; 9 | -------------------------------------------------------------------------------- /lib/main.coffee: -------------------------------------------------------------------------------- 1 | 2 | # Tone 3 | 4 | fs = require 'fs' 5 | chroma = require 'chroma-js' 6 | 7 | # Variables 8 | root = document.documentElement 9 | syntaxVariablesPath = "#{__dirname}/../styles/syntax-variables.less" 10 | writeSyntaxVariablesTimeout = null 11 | syncUI = null 12 | 13 | # Colors 14 | uno1 = '' 15 | uno2 = '' 16 | duo1 = '' 17 | duo2 = '' 18 | tri1 = '' 19 | tri2 = '' 20 | bg1 = '' 21 | bg2 = '' 22 | bg3 = '' 23 | fg1 = '' 24 | fg2 = '' 25 | cl = '' 26 | 27 | 28 | module.exports = 29 | activate: (state) -> 30 | uno1 = atom.config.get('tone-syntax.color.uno').toHexString() 31 | duo1 = atom.config.get('tone-syntax.color.duo').toHexString() 32 | tri1 = atom.config.get('tone-syntax.color.tri').toHexString() 33 | bg1 = atom.config.get('tone-syntax.color.bg').toHexString() 34 | syncUI = atom.config.get('tone-syntax.color.syncUI') 35 | 36 | setColors() 37 | 38 | # Change Uno 39 | atom.config.onDidChange 'tone-syntax.color.uno', ({newValue, oldValue}) -> 40 | uno1 = newValue.toHexString() 41 | setColors() 42 | unSyncUI() 43 | 44 | # Change Duo 45 | atom.config.onDidChange 'tone-syntax.color.duo', ({newValue, oldValue}) -> 46 | duo1 = newValue.toHexString() 47 | setColors() 48 | unSyncUI() 49 | 50 | # Change Tri 51 | atom.config.onDidChange 'tone-syntax.color.tri', ({newValue, oldValue}) -> 52 | tri1 = newValue.toHexString() 53 | setColors() 54 | unSyncUI() 55 | 56 | # Change BG 57 | atom.config.onDidChange 'tone-syntax.color.bg', ({newValue, oldValue}) -> 58 | bg1 = newValue.toHexString() 59 | setColors() 60 | unSyncUI() 61 | 62 | # Change Sync UI 63 | atom.config.onDidChange 'tone-syntax.color.syncUI', ({newValue, oldValue}) -> 64 | syncUI = newValue 65 | if syncUI is true then updateSyntaxVariables(syntaxVariablesPath) 66 | 67 | deactivate: -> 68 | unsetColors() 69 | 70 | 71 | 72 | # Set Colors ----------------------- 73 | 74 | setColors = -> 75 | 76 | # Create all different shades 77 | 78 | # uno1 # <- set by user 79 | uno2 = chroma.mix( uno1, bg1, .5) # how much bg 80 | 81 | # duo1 # <- set by user 82 | duo2 = chroma.mix( duo1, bg1, .5) # how much bg 83 | 84 | # tri1 # <- set by user 85 | tri2 = chroma.mix( tri1, bg1, .5) # how much bg 86 | 87 | # bg1 # <- set by user 88 | bg2 = chroma.mix( bg1, uno1, .04) # how much uno 89 | bg3 = chroma.mix( bg1, uno1, .12) # how much uno 90 | 91 | fg1 = chroma.mix( bg1, uno1, .3) # how much uno 92 | fg2 = chroma.mix( bg1, uno1, .1) # how much uno 93 | 94 | cl = chroma(uno1).alpha(0.04).css() # cursor line needs to have alpha 95 | 96 | # Remove all properties 97 | # Prevents adding endless properties 98 | unsetColors() 99 | 100 | # Update custom properties 101 | root.style.setProperty('--uno-1', uno1) 102 | root.style.setProperty('--uno-2', uno2) 103 | 104 | root.style.setProperty('--duo-1', duo1) 105 | root.style.setProperty('--duo-2', duo2) 106 | 107 | root.style.setProperty('--tri-1', tri1) 108 | root.style.setProperty('--tri-2', tri2) 109 | 110 | root.style.setProperty('--bg-1', bg1) 111 | root.style.setProperty('--bg-2', bg2) 112 | root.style.setProperty('--bg-3', bg3) 113 | 114 | root.style.setProperty('--fg-1', fg1) 115 | root.style.setProperty('--fg-2', fg2) 116 | 117 | root.style.setProperty('--cl', cl) 118 | 119 | root.style.setProperty('--accent', tri1) 120 | 121 | 122 | 123 | # Unset Colors ----------------------- 124 | 125 | unsetColors = -> 126 | # Remove all properties (e.g. when switching to another theme) 127 | root.style.removeProperty('--uno-1') 128 | root.style.removeProperty('--uno-2') 129 | 130 | root.style.removeProperty('--duo-1') 131 | root.style.removeProperty('--duo-2') 132 | 133 | root.style.removeProperty('--tri-1') 134 | root.style.removeProperty('--tri-2') 135 | 136 | root.style.removeProperty('--bg-1') 137 | root.style.removeProperty('--bg-2') 138 | root.style.removeProperty('--bg-3') 139 | 140 | root.style.removeProperty('--fg-1') 141 | root.style.removeProperty('--fg-2') 142 | 143 | root.style.removeProperty('--cl') 144 | 145 | root.style.removeProperty('--accent') 146 | 147 | 148 | 149 | # Syntax Variables ----------------------- 150 | 151 | unSyncUI = -> 152 | # Mark the syntax variables as "out of sync" 153 | if syncUI is true then atom.config.set('tone-syntax.color.syncUI', false) 154 | 155 | 156 | generateSyntaxVariables = -> 157 | # Here all the Syntax Variables get filled with the right values 158 | syntaxVariables = """ 159 | // Official Syntax Variables ----------------------------------- 160 | // Generated from lib/main.coffee 161 | 162 | /* Config: 163 | "tone-syntax": 164 | color: 165 | bg: "#{bg1}" 166 | duo: "#{duo1}" 167 | tri: "#{tri1}" 168 | uno: "#{uno1}" 169 | */ 170 | 171 | // General colors 172 | @syntax-text-color: #{uno1}; 173 | @syntax-cursor-color: #{tri1}; 174 | @syntax-selection-color: #{bg3}; 175 | @syntax-selection-flash-color: #{duo1}; 176 | @syntax-background-color: #{bg1}; 177 | 178 | // Guide colors 179 | @syntax-wrap-guide-color: #{bg2}; 180 | @syntax-indent-guide-color: #{fg2}; 181 | @syntax-invisible-character-color: #{fg2}; 182 | 183 | // For find and replace markers 184 | @syntax-result-marker-color: #{tri1}; 185 | @syntax-result-marker-color-selected: #{tri1}; 186 | 187 | // Gutter colors 188 | @syntax-gutter-text-color: #{fg1}; 189 | @syntax-gutter-text-color-selected: #{uno1}; 190 | @syntax-gutter-background-color: #{bg1}; 191 | @syntax-gutter-background-color-selected: #{bg2}; 192 | 193 | // For git diff info. i.e. in the gutter 194 | @syntax-color-renamed: hsl(208, 100%, 60%); 195 | @syntax-color-added: hsl(150, 60%, 54%); 196 | @syntax-color-modified: hsl(40, 60%, 70%); 197 | @syntax-color-removed: hsl(0, 70%, 60%); 198 | 199 | // For language entity colors 200 | @syntax-color-variable: #{tri1}; 201 | @syntax-color-constant: #{duo1}; 202 | @syntax-color-property: #{duo1}; 203 | @syntax-color-value: #{tri1}; 204 | @syntax-color-function: #{uno1}; 205 | @syntax-color-method: #{uno1}; 206 | @syntax-color-class: #{tri1}; 207 | @syntax-color-keyword: #{duo1}; 208 | @syntax-color-tag: #{uno1}; 209 | @syntax-color-attribute: #{uno2}; 210 | @syntax-color-import: #{uno1}; 211 | @syntax-color-snippet: #{uno1}; 212 | """ 213 | return syntaxVariables 214 | 215 | 216 | updateSyntaxVariables = -> 217 | # Only write to syntax-variables.less after a short delay 218 | # Because some people just love to stress-test checkboxes 219 | clearTimeout(writeSyntaxVariablesTimeout) 220 | writeSyntaxVariablesTimeout = setTimeout( -> 221 | fs.writeFileSync syntaxVariablesPath, generateSyntaxVariables() 222 | 1000) 223 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tone-syntax", 3 | "theme": "syntax", 4 | "version": "0.2.2", 5 | "description": "An Atom syntax theme with customizable colors", 6 | "keywords": [ 7 | "tone", 8 | "syntax", 9 | "customizable" 10 | ], 11 | "repository": "https://github.com/simurai/tone-syntax", 12 | "license": "MIT", 13 | "main": "lib/main", 14 | "engines": { 15 | "atom": ">1.9.0 <2.0.0" 16 | }, 17 | "dependencies": { 18 | "chroma-js": "1.1.1" 19 | }, 20 | "configSchema": { 21 | "color": { 22 | "title": "Custom Colors", 23 | "type": "object", 24 | "properties": { 25 | "uno": { 26 | "title": "Uno", 27 | "description": "Customize the main color", 28 | "order": 1, 29 | "type": "color", 30 | "default": "#dbdbff" 31 | }, 32 | "duo": { 33 | "title": "Duo", 34 | "description": "Customize the first accent color", 35 | "order": 2, 36 | "type": "color", 37 | "default": "#6cbeff" 38 | }, 39 | "tri": { 40 | "title": "Tri", 41 | "description": "Customize the second accent color", 42 | "order": 3, 43 | "type": "color", 44 | "default": "#1fffd2" 45 | }, 46 | "bg": { 47 | "title": "Background", 48 | "description": "Customize the background color", 49 | "order": 4, 50 | "type": "color", 51 | "default": "#2e2e43" 52 | }, 53 | "syncUI": { 54 | "title": "Sync UI", 55 | "description": "After making some changes, enable this to sync the colors also with other UI themes and packages. Note: It may take a few seconds to take effect. Doing this manually keeps the performance police happy. 🚓", 56 | "order": 5, 57 | "type": "boolean", 58 | "default": "true" 59 | } 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /spec/coffeescript.coffee: -------------------------------------------------------------------------------- 1 | 2 | # 1. Example ---------------------------------- 3 | 4 | class Animal 5 | constructor: (@name) -> 6 | 7 | move: (meters) -> 8 | alert @name + " moved #{meters}m." 9 | 10 | class Snake extends Animal 11 | move: -> 12 | alert "Slithering..." 13 | super 5 14 | 15 | class Horse extends Animal 16 | move: -> 17 | alert "Galloping..." 18 | super 45 19 | 20 | sam = new Snake "Sammy the Python" 21 | tom = new Horse "Tommy the Palomino" 22 | 23 | sam.move() 24 | tom.move() 25 | 26 | 27 | # 2. Tests ---------------------------------- 28 | 29 | # Assignment: 30 | number = 42 31 | opposite = true 32 | not-true = false 33 | 34 | # Conditions: 35 | number = -42 if opposite 36 | 37 | # Functions: 38 | square = (x) -> x * x 39 | 40 | # Arrays: 41 | list = [1, 2, 3, 4, 5] 42 | 43 | # Objects: 44 | math = 45 | root: Math.sqrt 46 | square: square 47 | cube: (x) -> x * square x 48 | 49 | # Splats: 50 | race = (winner, runners...) -> 51 | print winner, runners 52 | 53 | # Existence: 54 | alert "I knew it!" if elvis? 55 | 56 | # Array comprehensions: 57 | cubes = (math.cube num for num in list) 58 | -------------------------------------------------------------------------------- /spec/csharp.cs: -------------------------------------------------------------------------------- 1 | 2 | // 1. Example ---------------------------------- 3 | 4 | public class Hello1 5 | { 6 | public static void Main() 7 | { 8 | System.Console.WriteLine("Hello, World!"); 9 | } 10 | } 11 | 12 | 13 | // 2. Tests ---------------------------------- 14 | 15 | public class Trio : IEnumerable 16 | { 17 | public string Name1 { get; set; } 18 | public string Name2 { get; set; } 19 | public string Name3 { get; set; } 20 | public IEnumerator GetEnumerator() { return new TrioEnumerator(this); } 21 | } 22 | public class TrioEnumerator : IEnumerator 23 | { 24 | public TrioEnumerator(Trio trio) { _trio = trio; } 25 | private Trio _trio; 26 | private int _index = 0; 27 | public void Reset() { _index = 0; Current = null; } 28 | public object Current { get; private set; } 29 | public bool MoveNext() 30 | { 31 | _index++; 32 | /**/ if (_index == 1) { Current = _trio.Name1; return true; } 33 | else if (_index == 2) { Current = _trio.Name2; return true; } 34 | else if (_index == 3) { Current = _trio.Name3; return true; } 35 | else return false; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spec/css.css: -------------------------------------------------------------------------------- 1 | 2 | html { 3 | font-family: 'Lucida Grande', Verdana, sans-serif; 4 | font-size: 16px; 5 | line-height: 1.5; 6 | color: #333; 7 | background-color: hsl(30,100%,96%); 8 | } 9 | 10 | a { 11 | color: cornflowerblue; 12 | text-decoration: none; 13 | } 14 | 15 | a:hover { 16 | color: blue; 17 | } 18 | 19 | .avatar { 20 | display: inline-block; 21 | width: 48px; 22 | height: 48px; 23 | border-radius: 50%; 24 | } 25 | 26 | 27 | /* 2. Tests -------------------------------- */ 28 | 29 | .values { 30 | display: flex; 31 | display: none !important; 32 | 33 | content: "Hello"; 34 | 35 | width: auto; 36 | width: 0; 37 | width: 100px; 38 | width: 100%; 39 | width: 1em; 40 | width: 1vw; 41 | 42 | color: black; 43 | color: #000; 44 | color: hsl(0,0%,0%); 45 | color: transparent; 46 | 47 | font-size: initial; 48 | font-size: inherit; 49 | 50 | font-family: 'Lucida Grande', Verdana, sans-serif; 51 | 52 | background: url("atom.svg") no-repeat center; 53 | background: linear-gradient(to left, transparent, black) no-repeat center; 54 | } 55 | 56 | .valid { 57 | background: blue; /* valid property + value */ 58 | invalid-property: invalid-color; /* invalid property + value */ 59 | } 60 | 61 | h1, 62 | .class, 63 | #id, 64 | [attribute="true"], 65 | 66 | .state:hover, 67 | .pseudo::before, 68 | 69 | .nth:first-child, 70 | .nth:nth-child(even) {} 71 | 72 | @media screen and (max-width: 1000px) and (min-width: 500px) {} 73 | @import url('print.css'); 74 | -------------------------------------------------------------------------------- /spec/gfm.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # I love cheese 5 | 6 | Queso _cheese_ and wine blue __castello__. Cream cheese cheesy grin stilton halloumi jarlsberg the big cheese danish fontina stinking bishop. Smelly cheese smelly cheese cheese and biscuits edam hard cheese hard cheese croque monsieur monterey jack. Cream cheese. 7 | 8 | ![image](http://lorempixel.com/800/200/) 9 | 10 | Mozzarella cheese and wine cheddar. Cheesy grin st. agur blue cheese say cheese fondue who moved my cheese rubber cheese cheesecake fromage frais. Roquefort cheesy feet bocconcini cheese and wine __cheese triangles__ camembert de normandie queso cheese strings. Cheese strings cheese and biscuits cheese on toast. 11 | 12 | > Source: [cheeseipsum.co.uk](http://www.cheeseipsum.co.uk) 13 | 14 | 15 | 16 | 17 | # hello world 18 | ## hello world 19 | ### hello world 20 | #### hello world 21 | ##### hello world 22 | ###### hello world 23 | 24 | hello world 25 | =========== 26 | 27 | hello world 28 | ----------- 29 | 30 | one _thing_ has *em* phasis 31 | two __things__ are **bold** 32 | **combined _things_** 33 | ~~Scratched thing~~ New thing 34 | 35 | * list 36 | * list 37 | - nested list 38 | - nested list 39 | 40 | - [ ] Something to be done 41 | - [x] Accomplished task 42 | 43 | 1. one thing 44 | 2. two thing 45 | 46 | [link](http://atom.io) 47 | [link](http://atom.io "with title") 48 | 49 | ![image](http://lorempixel.com/800/200/) 50 | 51 | Inline ``. 52 | 53 | ```html 54 | 55 |
56 | ``` 57 | 58 | | This | is a | Table | 59 | | ------------- |:-------------:| -----:| 60 | | col 1 is | left-aligned | 1600 | 61 | | col 2 is | centered | 300 | 62 | | col 3 is | right-aligned | 47 | 63 | 64 | 65 | > A blockquote. 66 | 67 |

Inline HTML

68 | 69 | --- 70 | *** 71 | ___ 72 | 73 | Keyboard shortcut: cmd-s 74 | -------------------------------------------------------------------------------- /spec/git.COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | This is the summary line. It can't be too long. 2 | 3 | After I can write a much more detailed description without quite the 4 | same restrictions on length. 5 | 6 | But if the line gets toooooooooooooooooooo long, you should add a line break. 7 | 8 | # Please enter the commit message for your changes. Lines starting 9 | # with '#' will be ignored, and an empty message aborts the commit. 10 | # On branch master 11 | # Your branch is up-to-date with 'origin/master'. 12 | # 13 | # Changes to be committed: 14 | # deleted: README.md 15 | # modified: index.less 16 | # new file: spec/COMMIT_EDITMSG 17 | # 18 | -------------------------------------------------------------------------------- /spec/go.go: -------------------------------------------------------------------------------- 1 | 2 | // 1. Example ---------------------------------- 3 | 4 | package main 5 | 6 | import "fmt" 7 | func main() { 8 | fmt.Println("hello world") 9 | } 10 | 11 | 12 | // 2. Tests ---------------------------------- 13 | 14 | // Values 15 | fmt.Println("go" + "lang") 16 | fmt.Println("1+1 =", 1+1) 17 | fmt.Println("7.0/3.0 =", 7.0/3.0) 18 | fmt.Println(true && false) 19 | fmt.Println(true || false) 20 | fmt.Println(!true) 21 | 22 | // Variables 23 | var a string = "initial" 24 | var b, c int = 1, 2 25 | var d = true 26 | var e int 27 | f := "short" 28 | 29 | // Constants 30 | const n = 500000000 31 | const d = 3e20 / n 32 | 33 | // For 34 | for j := 7; j <= 9; j++ { 35 | fmt.Println(j) 36 | } 37 | 38 | // If/Else 39 | if 7%2 == 0 { 40 | fmt.Println("7 is even") 41 | } else { 42 | fmt.Println("7 is odd") 43 | } 44 | 45 | // Array 46 | b := [5]int{1, 2, 3, 4, 5} 47 | fmt.Println("dcl:", b) 48 | 49 | // Function 50 | func main() { 51 | res := plus(1, 2) 52 | fmt.Println("1+2 =", res) 53 | 54 | res = plusPlus(1, 2, 3) 55 | fmt.Println("1+2+3 =", res) 56 | } 57 | -------------------------------------------------------------------------------- /spec/html.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Title 8 | 9 | 10 | 11 | 18 | 19 | 20 | 21 | 27 | 28 |
29 |

HTML example

30 |

The HTML p element (or HTML Paragraph Element) represents a paragraph of text. Paragraphs are block-level elements.

31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Title 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
49 | 50 | 51 |
Text
52 |
 
53 |
54 | 55 | 56 |
57 |
58 | 59 | Logo 60 | 61 | -------------------------------------------------------------------------------- /spec/java.java: -------------------------------------------------------------------------------- 1 | 2 | // 1. Example ---------------------------- 3 | 4 | public class ReverseNumber { 5 | 6 | public static void main(String[] args) { 7 | 8 | //original number 9 | int number = 1234; 10 | int reversedNumber = 0; 11 | int temp = 0; 12 | 13 | while(number > 0){ 14 | //use modulus operator to strip off the last digit 15 | temp = number%10; 16 | 17 | //create the reversed number 18 | reversedNumber = reversedNumber * 10 + temp; 19 | number = number/10; 20 | } 21 | 22 | //output the reversed number 23 | System.out.println("Reversed Number is: " + reversedNumber); 24 | } 25 | } 26 | 27 | 28 | // 2. Tests ---------------------------- 29 | 30 | public class Test { 31 | public void test(Object a) { 32 | System.out.println("hello"); 33 | if(a instanceof String) { 34 | System.out.println("it's me"); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spec/javascript.js: -------------------------------------------------------------------------------- 1 | 2 | var Sales = "Toyota"; 3 | 4 | function CarTypes(name) { 5 | if (name == "Honda") { 6 | return name; 7 | } else { 8 | return "Sorry, we don't sell " + name + "."; 9 | } 10 | } 11 | 12 | var car = { myCar: "Saturn", getCar: CarTypes("Honda"), special: Sales }; 13 | 14 | console.log(car.special); 15 | 16 | // ES6 --------------------------- 17 | 18 | const templateString = `${car.myCar} is a ${Sales} yay`; 19 | 20 | const obj = { 21 | [myKey]: 'val', 22 | method(x, y) { 23 | return x ** y; 24 | }, 25 | ...(foo ? obj1 : obj2) 26 | } 27 | 28 | class MyClass extends BaseClass { 29 | constructor(...args) { 30 | super(...args); 31 | 32 | this.foo = args.foo; 33 | } 34 | 35 | fooMethod(bar = 'defaultValue', { items, baz: qux, ...rest, }) { 36 | this.arr = [...items]; 37 | 38 | return this.arr.map(x => x * 2); 39 | } 40 | } 41 | 42 | 43 | // 2. Tests ---------------------- 44 | 45 | 46 | return { 47 | restrict: 'E', 48 | transclude: true, 49 | transclude: false, 50 | scope: { 51 | options: '=' 52 | }, 53 | templateUrl: 'js/...', 54 | controllerAs: 'vm', 55 | bindToController: true, 56 | controller: function (NgTableParams, TABLE_OPTIONS_FIELD) { 57 | var vm = this; 58 | } 59 | }; 60 | -------------------------------------------------------------------------------- /spec/json.json: -------------------------------------------------------------------------------- 1 | { 2 | { "1.": "Example" }, 3 | { "First level": "Example" }, 4 | { 5 | "widget": { 6 | "debug": "on", 7 | "window": { 8 | "title": "Sample Konfabulator Widget", 9 | "name": "main_window", 10 | "width": 500, 11 | "height": 500 12 | }, 13 | "image": { 14 | "src": "Images/Sun.png", 15 | "name": "sun1", 16 | "hOffset": 250, 17 | "vOffset": 250, 18 | "alignment": "center" 19 | }, 20 | "text": { 21 | "data": "Click Here", 22 | "size": 36, 23 | "style": "bold", 24 | "name": "text1", 25 | "hOffset": 250, 26 | "vOffset": 100, 27 | "alignment": "center", 28 | "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" 29 | } 30 | } 31 | }, 32 | 33 | 34 | { "2.": "Tests" }, 35 | { 36 | "count": [17500, null, "String"], 37 | "description": {"text": "She said, \"Hello\"", "sensitive": false} 38 | }, 39 | { 40 | "deeply_nested": { 41 | "key": { 42 | "key": { 43 | "key": { 44 | "array": [1, "two", null], 45 | "string": "hello" 46 | } 47 | } 48 | } 49 | } 50 | }, 51 | { 52 | //"comment": "test", 53 | "proper-comment": "JSON doesn't allow for comments, and the two slash characters on the line above should be rendered as invalid entities" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /spec/less.less: -------------------------------------------------------------------------------- 1 | 2 | /* 1. Example -------------------------------- */ 3 | 4 | @import "mixins"; 5 | 6 | @foreground-color: #333; 7 | @background-color: hsl(30,100%,96%); 8 | 9 | html { 10 | font-family: 'Lucida Grande', Verdana, sans-serif; 11 | font-size: 16px; 12 | line-height: 1.5; 13 | color: @foreground-color; 14 | background-color: @background-color; 15 | } 16 | 17 | a { 18 | color: @link-color; 19 | text-decoration: none; 20 | &:hover { 21 | color: lighten(@link-color, 5%); 22 | } 23 | } 24 | 25 | .avatar { 26 | display: inline-block; 27 | width: 48px; 28 | height: 48px; 29 | border-radius: 50%; 30 | } 31 | 32 | 33 | /* 2. Tests -------------------------------- */ 34 | 35 | @import "variables"; 36 | @import (reference) "variables"; 37 | 38 | @variable: 10px; 39 | 40 | .variables { 41 | @variable: 10px; 42 | @another-variable: @variable; 43 | 44 | width: @variable + @another-variable; 45 | width: @variable*2; 46 | 47 | } 48 | 49 | .functions { 50 | color: hue(orange); 51 | color: lighten(@color, 10%); 52 | color: mix(@color, #000, 25%); 53 | width: max(5, 10); 54 | width: unit(5, px); 55 | } 56 | 57 | .nested { 58 | .class {} 59 | &::before {} 60 | & + & {} 61 | .class & {} 62 | @media screen {} 63 | } 64 | 65 | .mixin {}; 66 | .mixin() {}; 67 | .mixin(@default: 10px) {}; 68 | 69 | .use-mixin { 70 | .mixin; 71 | .mixin(); 72 | .mixin(5px); 73 | } 74 | 75 | .class {} 76 | .extended { 77 | &:extend(.class); 78 | background: blue; 79 | } 80 | 81 | .guard() when (lightness(@a) >= 50%) {} 82 | .guard(); 83 | 84 | .test { 85 | all: unset; 86 | } 87 | -------------------------------------------------------------------------------- /spec/php.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 24 | 25 | property; 48 | } 49 | 50 | /** 51 | * Set property 52 | * 53 | * @param string|null $property 54 | */ 55 | public function setProperty(?string $property) : void 56 | { 57 | $this->property = $property; 58 | 59 | $this->logInfo('Property has been set.'); 60 | } 61 | } 62 | ?> 63 | -------------------------------------------------------------------------------- /spec/python.py: -------------------------------------------------------------------------------- 1 | 2 | # 1. Example ------------------------ 3 | 4 | import unittest 5 | def median(pool): 6 | copy = sorted(pool) 7 | size = len(copy) 8 | if size % 2 == 1: 9 | return copy[(size - 1) / 2] 10 | else: 11 | return (copy[size/2 - 1] + copy[size/2]) / 2 12 | class TestMedian(unittest.TestCase): 13 | def testMedian(self): 14 | self.failUnlessEqual(median([2, 9, 9, 7, 9, 2, 4, 5, 8]), 7) 15 | if __name__ == '__main__': 16 | unittest.main() 17 | 18 | 19 | # 2. Tests ------------------------ 20 | 21 | 22 | # Function definition is here 23 | def printme( str ): 24 | "This prints a passed string into this function" 25 | print str 26 | return; 27 | 28 | def __init__(self, *args, **kwargs): 29 | super().__init__(*args, **kwargs) 30 | self.error = MDText() 31 | self.add_widget(self.error, canvas='after') 32 | 33 | class FloatingAction(Factory.IconButton): 34 | action = ObjectProperty(allownone=True) 35 | 36 | def _show(self, *args): 37 | Animation.cancel_all(self) 38 | Animation(font_size=self.target_font_size), 39 | d=0.1, 40 | t='linear').start(self) 41 | -------------------------------------------------------------------------------- /spec/ruby.rb: -------------------------------------------------------------------------------- 1 | 2 | # 1. Example ----------------------------- 3 | 4 | class Person 5 | attr_reader :name, :age 6 | def initialize(name, age) 7 | @name, @age = name, age 8 | end 9 | def <=>(person) # the comparison operator for sorting 10 | age <=> person.age 11 | end 12 | def to_s 13 | "#{name} (#{age})" 14 | end 15 | end 16 | 17 | group = [ 18 | Person.new("Bob", 33), 19 | Person.new("Chris", 16), 20 | Person.new("Ash", 23) 21 | ] 22 | 23 | puts group.sort.reverse 24 | 25 | 26 | # 2. Tests ----------------------------- 27 | 28 | def initialize(rbconfig) 29 | 30 | begin 31 | File.foreeach(safefile()) do |line| 32 | k, v = *line.split(/=/, 2) 33 | -------------------------------------------------------------------------------- /spec/sass.scss: -------------------------------------------------------------------------------- 1 | 2 | /* 1. Example -------------------------------- */ 3 | 4 | @import 'mixins'; 5 | 6 | $foreground-color: #333; 7 | $background-color: hsl(30,100%,96%); 8 | 9 | html { 10 | font-family: 'Lucida Grande', Verdana, sans-serif; 11 | font-size: 16px; 12 | line-height: 1.5; 13 | color: $foreground-color; 14 | background-color: $background-color; 15 | } 16 | 17 | a { 18 | color: $link-color; 19 | text-decoration: none; 20 | &:hover { 21 | color: lighten($link-color, 5%); 22 | } 23 | } 24 | 25 | .avatar { 26 | display: inline-block; 27 | width: 48px; 28 | height: 48px; 29 | border-radius: 50%; 30 | } 31 | 32 | 33 | /* 2. Tests -------------------------------- */ 34 | 35 | @import 'variables'; 36 | 37 | $variable: $variable; 38 | 39 | .variables { 40 | $variable: 10px; 41 | $another-variable: $variable; 42 | 43 | width: $variable + $another-variable; 44 | width: $variable*2; 45 | } 46 | 47 | .functions { 48 | color: hue(orange); 49 | color: lighten(@color, 10%); 50 | color: mix(@color, #000, 25%); 51 | width: max(5, 10); 52 | width: unit(5, px); 53 | } 54 | 55 | .nested { 56 | .class {} 57 | &::before {} 58 | & + & {} 59 | .class & {} 60 | @media screen {} 61 | } 62 | 63 | @mixin size($var) {}; 64 | .use-mixin { 65 | @include size(10px); 66 | } 67 | 68 | .class {} 69 | .extended { 70 | @extend .class; 71 | background: blue; 72 | } 73 | -------------------------------------------------------------------------------- /spec/text.txt: -------------------------------------------------------------------------------- 1 | 2 | 1. Example 3 | 4 | The station at Allahabad was reached about ten o'clock, and, the interrupted line of railway being resumed, would enable them to reach Calcutta in less than twenty-four hours. Phileas Fogg would thus be able to arrive in time to take the steamer which left Calcutta the next day, October 25th, at noon, for Hong Kong. 5 | -------------------------------------------------------------------------------- /spec/todo.txt: -------------------------------------------------------------------------------- 1 | 2 | 1. Example 3 | 4 | Adds syntax highlighting to TODO's in comments and text in Atom. 5 | 6 | 7 | 2. Tests 8 | 9 | NOTE: Everything bellow should be highlighted: 10 | 11 | TODO 12 | FIXME 13 | CHANGED 14 | XXX 15 | IDEA 16 | HACK 17 | NOTE 18 | REVIEW 19 | -------------------------------------------------------------------------------- /spec/typescript.ts: -------------------------------------------------------------------------------- 1 | 2 | // Example 3 | 4 | const myGreeter = new Greeter("hello, world"); 5 | myGreeter.greeting = "howdy"; 6 | myGreeter.showGreeting(); 7 | 8 | class SpecialGreeter extends Greeter { 9 | constructor() { 10 | super("Very special greetings"); 11 | } 12 | } 13 | 14 | // Tests 15 | 16 | declare namespace GreetingLib { 17 | interface LogOptions { 18 | verbose?: boolean; 19 | } 20 | interface AlertOptions { 21 | modal: boolean; 22 | title?: string; 23 | color?: string; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /styles/editor.less: -------------------------------------------------------------------------------- 1 | 2 | // Editor styles (background, gutter, guides) 3 | 4 | atom-text-editor { 5 | .uno-1(); // @syntax-text-color 6 | .bg-1(); // @syntax-background-color 7 | 8 | .line.cursor-line { 9 | .cl(); 10 | } 11 | 12 | .selection .region { 13 | .bg-3(); // @syntax-selection-color 14 | } 15 | 16 | .cursor { 17 | border-color: var(--accent); // @syntax-cursor-color 18 | border-left-width: 2px; 19 | } 20 | 21 | .bracket-matcher .region { 22 | border-bottom: 1px solid var(--accent); 23 | } 24 | 25 | .invisible { 26 | .fg-2(); 27 | } 28 | 29 | .invisible-character { 30 | .fg-2(); // @syntax-invisible-character-color 31 | -webkit-font-smoothing: antialiased; 32 | } 33 | 34 | .indent-guide { 35 | .fg-2(); // @syntax-indent-guide-color 36 | } 37 | 38 | .wrap-guide { 39 | .bg-2(); // @syntax-wrap-guide-color 40 | } 41 | 42 | // find + replace 43 | .find-result .region.region.region, 44 | .current-result .region.region.region { 45 | border: none; 46 | border-radius: 0px; 47 | background-color: var(--duo-1); 48 | opacity: .15; 49 | transition: none; 50 | } 51 | 52 | // highlight-selected 53 | // Attribute selector needed since background will be asked to change to -> syntax--background 54 | [class="highlight highlight-selected background"] .region.region.region.region { 55 | background-color: var(--duo-1); 56 | opacity: .15; 57 | } 58 | 59 | .gutter { 60 | 61 | .line-number { 62 | .fg-1(); // @syntax-gutter-text-color 63 | -webkit-font-smoothing: antialiased; 64 | 65 | &.git-line-removed:before { 66 | bottom: -3px; 67 | } 68 | &.git-line-removed:after { 69 | content: ""; 70 | position: absolute; 71 | left: 0px; 72 | bottom: 0px; 73 | width: 25px; 74 | border-bottom: 1px dotted fade(@syntax-color-removed, 50%); 75 | pointer-events: none; 76 | } 77 | 78 | &.cursor-line { 79 | .uno-1(); // @syntax-gutter-text-color-selected 80 | .bg-2(); // @syntax-gutter-background-color-selected 81 | } 82 | 83 | &.cursor-line-no-selection { 84 | background-color: transparent; 85 | } 86 | 87 | .icon-right { 88 | .uno-1(); 89 | } 90 | } 91 | } 92 | 93 | .gutter .line-number.folded, 94 | .gutter .line-number:after, 95 | .fold-marker:after { 96 | .uno-1(); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /styles/languages/_base.less: -------------------------------------------------------------------------------- 1 | // Language syntax highlighting 2 | 3 | .@{s}comment, 4 | .@{s}brace, 5 | .@{s}punctuation 6 | { .fg-1(); } 7 | 8 | .@{s}comment.@{s}documentation 9 | { .uno-2(); } 10 | 11 | // Default, Will be used by all languages when no other scope is defined 12 | .@{s}source 13 | { .uno-1(); } 14 | 15 | 16 | // Language entities ----------------------------------- 17 | 18 | .@{s}function { .uno-1(); } 19 | .@{s}method { .uno-1(); } 20 | .@{s}tag { .uno-1(); } 21 | .@{s}import { .uno-1(); } 22 | .@{s}snippet { .uno-1(); } 23 | .@{s}attribute { .uno-2(); } 24 | .@{s}attribute-name { .uno-2(); } 25 | 26 | .@{s}constant { .duo-1(); } 27 | .@{s}property { .duo-1(); } 28 | .@{s}keyword { .duo-1(); } 29 | 30 | .@{s}class { .tri-1(); } 31 | .@{s}variable { .tri-1(); } 32 | .@{s}value { .tri-1(); } 33 | .@{s}string { .tri-1(); } 34 | 35 | 36 | // Special case ----------------------------------- 37 | 38 | .@{s}comment { 39 | font-style: italic; 40 | & > * { 41 | color: inherit; 42 | } 43 | } 44 | 45 | .@{s}bold { 46 | font-weight: bold; 47 | } 48 | 49 | .@{s}italic { 50 | font-style: italic; 51 | } 52 | -------------------------------------------------------------------------------- /styles/languages/_index.less: -------------------------------------------------------------------------------- 1 | 2 | // Prefix 3 | @s: syntax--; // this prefix is required for all langage selectors 4 | 5 | // Base 6 | @import '_base'; 7 | 8 | // Supported languages 9 | @import 'coffee'; 10 | @import 'csharp'; 11 | @import 'css'; 12 | @import 'gfm'; 13 | @import 'git-commit'; 14 | @import 'go'; 15 | @import 'html'; 16 | @import 'java'; 17 | @import 'javascript'; 18 | @import 'json'; 19 | @import 'less'; 20 | @import 'php'; 21 | @import 'python'; 22 | @import 'ruby'; 23 | @import 'scss'; 24 | @import 'text'; 25 | @import 'todo'; 26 | @import 'typescript'; 27 | -------------------------------------------------------------------------------- /styles/languages/coffee.less: -------------------------------------------------------------------------------- 1 | // Coffee 2 | 3 | .@{s}coffee { 4 | 5 | &.@{s}class.@{s}storage { 6 | .uno-1(); 7 | } 8 | 9 | &.@{s}keyword { 10 | .duo-2(); 11 | } 12 | &.@{s}class.@{s}name, 13 | &.@{s}inherited-class { 14 | .duo-1(); 15 | } 16 | 17 | &.@{s}string { 18 | .tri-1(); 19 | } 20 | &.@{s}constant { 21 | .tri-1(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /styles/languages/csharp.less: -------------------------------------------------------------------------------- 1 | // C# 2 | 3 | .@{s}cs { 4 | 5 | &.@{s}punctuation.@{s}punctuation { 6 | .fg-1(); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /styles/languages/css.less: -------------------------------------------------------------------------------- 1 | // CSS 2 | 3 | .@{s}css { 4 | 5 | // invalid 6 | &.@{s}property-name, 7 | &.@{s}property-value 8 | { .fg-1(); } 9 | 10 | // valid 11 | &.@{s}property-name.@{s}support, 12 | &.@{s}pseudo-class 13 | { .uno-2(); } 14 | 15 | &.@{s}function 16 | { .uno-1(); } 17 | 18 | &.@{s}punctuation.@{s}constant, 19 | &.@{s}unit 20 | { .tri-2(); } 21 | 22 | &.@{s}string, 23 | &.@{s}constant 24 | { .tri-1(); } 25 | 26 | // Special case 27 | 28 | &.@{s}important { 29 | color: @syntax-color-removed; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /styles/languages/gfm.less: -------------------------------------------------------------------------------- 1 | // GF MarkDown 2 | 3 | .@{s}gfm { 4 | 5 | .@{s}link { 6 | .fg-1(); // ![]() 7 | } 8 | 9 | &.@{s}markup { 10 | 11 | &.@{s}bold { 12 | .uno-1(); 13 | font-weight: bold; 14 | } 15 | 16 | &.@{s}italic { 17 | .duo-1(); 18 | font-style: italic; 19 | } 20 | 21 | &.@{s}strike { 22 | .fg-1(); 23 | text-decoration: line-through; 24 | } 25 | 26 | &.@{s}raw { 27 | .tri-1(); // Fenced code 28 | } 29 | 30 | &.@{s}raw .@{s}support, 31 | &.@{s}code .@{s}support { 32 | .fg-1(); // Fenced code blocks 33 | } 34 | } 35 | 36 | &.@{s}quote { 37 | .uno-2(); 38 | } 39 | 40 | &.@{s}table { 41 | .uno-1(); 42 | 43 | .@{s}border, 44 | .@{s}pipe { 45 | .uno-2(); 46 | } 47 | } 48 | 49 | &.@{s}variable, 50 | &.@{s}entity { 51 | .duo-1(); 52 | } 53 | 54 | &.@{s}heading-1, 55 | &.@{s}heading-2, 56 | &.@{s}heading-3, 57 | &.@{s}heading-4, 58 | &.@{s}heading-5, 59 | &.@{s}heading-6 { 60 | .tri-1(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /styles/languages/git-commit.less: -------------------------------------------------------------------------------- 1 | // Git Commit Message 2 | 3 | .@{s}git-commit { 4 | 5 | 6 | 7 | // Special cases ---------------------- 8 | 9 | // Weak 2nd line 10 | [data-screen-row="1"] & { 11 | .uno-2(); 12 | } 13 | 14 | // Strong subject 15 | [data-screen-row="0"] & { 16 | .uno-1(); 17 | font-weight: 500; 18 | } 19 | 20 | &.@{s}deleted { 21 | color: @syntax-color-removed; 22 | } 23 | 24 | &.@{s}changed { 25 | color: @syntax-color-modified; 26 | } 27 | 28 | &.@{s}inserted { 29 | color: @syntax-color-added; 30 | } 31 | 32 | // Too long 33 | &.@{s}line-too-long.@{s}line-too-long { 34 | background-color: mix( @syntax-color-removed, @syntax-background-color, 33% ); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /styles/languages/go.less: -------------------------------------------------------------------------------- 1 | // Go 2 | 3 | .@{s}go { 4 | 5 | // func 6 | &.@{s}keyword.@{s}function { 7 | .uno-2(); 8 | } 9 | 10 | // import 11 | &.@{s}keyword.@{s}import { 12 | .uno-2(); 13 | } 14 | 15 | // var + const 16 | &.@{s}keyword.@{s}var, 17 | &.@{s}keyword.@{s}const { 18 | .tri-2(); 19 | } 20 | 21 | &.@{s}string { 22 | .duo-1(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /styles/languages/html.less: -------------------------------------------------------------------------------- 1 | // HTML 2 | 3 | .@{s}html { 4 | 5 | &.@{s}entity.@{s}name.@{s}tag { 6 | .uno-1(); 7 | } 8 | 9 | &.@{s}attribute-name { 10 | .duo-1(); 11 | } 12 | 13 | &.@{s}string { 14 | .tri-1(); 15 | } 16 | &.@{s}string.@{s}punctuation { 17 | .tri-2(); 18 | } 19 | 20 | // Special cases ------------------------- 21 | 22 | // links 23 | &.@{s}string .@{s}link { 24 | .duo-1(); 25 | font-style: italic; 26 | } 27 | 28 | // tags that are embedded 29 | &.@{s}embedded .@{s}entity.@{s}name.@{s}tag { 30 | .duo-1(); 31 | font-style: italic; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /styles/languages/java.less: -------------------------------------------------------------------------------- 1 | // Java 2 | 3 | .@{s}java { 4 | 5 | // self 6 | &.@{s}storage.@{s}modifier { 7 | .uno-2(); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /styles/languages/javascript.less: -------------------------------------------------------------------------------- 1 | // JavaScript 2 | 3 | .@{s}js { 4 | 5 | &.@{s}string { 6 | .uno-1(); 7 | } 8 | 9 | &.@{s}keyword { 10 | .duo-1(); 11 | } 12 | 13 | &.@{s}function.@{s}name, 14 | &.@{s}constant { 15 | .tri-1(); 16 | } 17 | 18 | @object-key: ~'.@{s}constant.@{s}other.@{s}object.@{s}key > .@{s}string.@{s}unquoted'; 19 | &@{object-key} { 20 | .uno-2(); 21 | } 22 | 23 | @template-string: ~'.@{s}string.@{s}template'; 24 | &@{template-string} { 25 | .duo-1(); 26 | } 27 | 28 | @template-string-quotes: ~'@{template-string} > .@{s}punctuation.@{s}begin, > .@{s}punctuation.@{s}end'; 29 | &@{template-string-quotes} { 30 | .tri-1(); 31 | } 32 | 33 | @template-string-expression: ~'@{template-string} > @{s}entity.@{s}quasi.@{s}element'; 34 | &@{template-string-expression} { 35 | .uno-1(); 36 | } 37 | 38 | @kw-class: ~'.@{s}storage.@{s}type.@{s}class'; 39 | &@{kw-class} { 40 | .uno-1(); 41 | } 42 | 43 | @kw-extends: ~'.@{s}storage.@{s}type.@{s}extends'; 44 | &@{kw-extends} { 45 | .duo-2(); 46 | } 47 | 48 | @class-name: ~'.@{s}class.@{s}entity.@{s}name'; 49 | &@{class-name} { 50 | .duo-1(); 51 | } 52 | 53 | @class-instance-method: ~'.@{s}class .@{s}entity.@{s}name.@{s}function.@{s}method'; 54 | &@{class-instance-method} { 55 | .uno-1(); 56 | } 57 | 58 | @class-method-params: ~'.@{s}class .@{s}meta.@{s}function.@{s}parameters'; 59 | &@{class-method-params} { 60 | .uno-2(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /styles/languages/json.less: -------------------------------------------------------------------------------- 1 | // JSON 2 | 3 | .@{s}json { 4 | 5 | &.@{s}invalid { 6 | .uno-2(); 7 | } 8 | 9 | &.@{s}value > .@{s}string { 10 | .duo-1(); 11 | } 12 | 13 | &.@{s}constant { 14 | .tri-1(); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /styles/languages/less.less: -------------------------------------------------------------------------------- 1 | // Less 2 | 3 | .@{s}less { 4 | &.@{s}function, 5 | &.@{s}import.@{s}option 6 | { .uno-1(); } 7 | 8 | &.@{s}variable, 9 | &.@{s}mixin 10 | { .duo-1(); } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /styles/languages/php.less: -------------------------------------------------------------------------------- 1 | // PHP 2 | 3 | .@{s}php { 4 | 5 | // class and function names 6 | .@{s}storage.@{s}type.@{s}class + .@{s}entity.@{s}name.@{s}class, 7 | .@{s}storage.@{s}type.@{s}function + .@{s}entity.@{s}name.@{s}function { 8 | .duo-1(); 9 | } 10 | 11 | // extends, class and function keywords 12 | &.@{s}storage.@{s}modifier.@{s}extends, 13 | &.@{s}storage.@{s}type.@{s}class, 14 | &.@{s}storage.@{s}type.@{s}function { 15 | .uno-1(); 16 | } 17 | 18 | // -> operator 19 | &.@{s}keyword.@{s}operator.@{s}class { 20 | .uno-2(); 21 | } 22 | 23 | // access modifiers (public, private, protected) 24 | &.@{s}storage.@{s}modifier { 25 | .uno-2(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /styles/languages/python.less: -------------------------------------------------------------------------------- 1 | // Python 2 | 3 | .@{s}python { 4 | 5 | // def 6 | &.@{s}storage.@{s}type.@{s}function { 7 | .uno-2(); 8 | } 9 | 10 | // class 11 | &.@{s}storage.@{s}type.@{s}class { 12 | .tri-2(); 13 | } 14 | 15 | // self 16 | &.@{s}self { 17 | .duo-2(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /styles/languages/ruby.less: -------------------------------------------------------------------------------- 1 | // Ruby 2 | 3 | .@{s}ruby { 4 | 5 | // def + end 6 | &.@{s}keyword.@{s}control { 7 | .uno-2(); 8 | } 9 | 10 | // class 11 | &.@{s}keyword.@{s}control.@{s}class { 12 | .tri-2(); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /styles/languages/scss.less: -------------------------------------------------------------------------------- 1 | // SCSS 2 | 3 | .@{s}scss { 4 | 5 | &.@{s}tag { 6 | .uno-1(); 7 | } 8 | 9 | &.@{s}variable, 10 | &.@{s}function { 11 | .duo-2(); 12 | } 13 | &.@{s}mixin { 14 | .duo-1(); 15 | } 16 | 17 | &.@{s}unit { 18 | .tri-2(); 19 | } 20 | &.@{s}string, 21 | &.@{s}constant { 22 | .tri-1(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /styles/languages/text.less: -------------------------------------------------------------------------------- 1 | // Text 2 | 3 | .@{s}text { 4 | .uno-1(); 5 | } 6 | -------------------------------------------------------------------------------- /styles/languages/todo.less: -------------------------------------------------------------------------------- 1 | // TODO 2 | 3 | .@{s}todo, 4 | .@{s}fixme, 5 | .@{s}changed, 6 | .@{s}xxx, 7 | .@{s}idea, 8 | .@{s}hack, 9 | .@{s}note, 10 | .@{s}review { 11 | .tri-1(); 12 | } 13 | -------------------------------------------------------------------------------- /styles/languages/typescript.less: -------------------------------------------------------------------------------- 1 | // Typescript 2 | 3 | .@{s}ts { 4 | 5 | // class 6 | &.@{s}storage.@{s}type.@{s}class { 7 | .tri-2(); 8 | } 9 | 10 | // declare 11 | &.@{s}storage.@{s}modifier { 12 | .uno-2(); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /styles/palette.less: -------------------------------------------------------------------------------- 1 | 2 | // Tone palette 3 | 4 | .uno-1 { color: var(--uno-1); } // ... Strong 5 | .uno-2 { color: var(--uno-2); } // .. | 6 | 7 | .duo-1 { color: var(--duo-1); } // ... Strong 8 | .duo-2 { color: var(--duo-2); } // .. Weak 9 | 10 | .tri-1 { color: var(--tri-1); } // ... Strong 11 | .tri-2 { color: var(--tri-2); } // .. Weak 12 | 13 | .bg-1 { background-color: var(--bg-1); } // ... Base 14 | .bg-2 { background-color: var(--bg-2); } // .. Weak 15 | .bg-3 { background-color: var(--bg-3); } // .. Strong 16 | 17 | .fg-1 { color: var(--fg-1); } // .. Strong 18 | .fg-2 { color: var(--fg-2); } // .. Weak 19 | 20 | .cl { background-color: var(--cl); } // uno-1 + alpha 21 | -------------------------------------------------------------------------------- /styles/settings.less: -------------------------------------------------------------------------------- 1 | 2 | // Custom settings 3 | 4 | .theme-tone-syntax .settings-view { 5 | 6 | [id="tone-syntax.color.uno"], 7 | [id="tone-syntax.color.duo"], 8 | [id="tone-syntax.color.tri"] { 9 | width: 2.75em; 10 | margin-left: -3.5em; 11 | position: absolute; 12 | height: 4em; 13 | border-radius: 4em; 14 | &::-webkit-color-swatch { 15 | border-radius: inherit; 16 | } 17 | &:hover { 18 | border-color: hsla(0,0%,100%,.2); 19 | } 20 | &:active { 21 | border-color: hsla(0,0%,100%,0); 22 | } 23 | } 24 | 25 | [id="tone-syntax.color.uno"]:after { 26 | content: ""; 27 | position: absolute; 28 | top: 0; 29 | left: -1.5em; 30 | width: 6px; 31 | height: 14em; 32 | border-radius: 1em; 33 | background-image: linear-gradient(to bottom, 34 | var(--uno-1) 16%, 35 | var(--uno-2) 16%, var(--uno-2) 33%, 36 | var(--duo-1) 33%, var(--duo-1) 50%, 37 | var(--duo-2) 50%, var(--duo-2) 66%, 38 | var(--tri-1) 66%, var(--tri-1) 83%, 39 | var(--tri-2) 83% 40 | ); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /styles/syntax-variables.less: -------------------------------------------------------------------------------- 1 | // Official Syntax Variables ----------------------------------- 2 | // Generated from lib/main.coffee 3 | 4 | /* Config: 5 | "tone-syntax": 6 | color: 7 | bg: "#2e2e43" 8 | duo: "#6cbeff" 9 | tri: "#1fffd2" 10 | uno: "#dbdbff" 11 | */ 12 | 13 | // General colors 14 | @syntax-text-color: #dbdbff; 15 | @syntax-cursor-color: #1fffd2; 16 | @syntax-selection-color: #424259; 17 | @syntax-selection-flash-color: #6cbeff; 18 | @syntax-background-color: #2e2e43; 19 | 20 | // Guide colors 21 | @syntax-wrap-guide-color: #34344a; 22 | @syntax-indent-guide-color: #3f3f55; 23 | @syntax-invisible-character-color: #3f3f55; 24 | 25 | // For find and replace markers 26 | @syntax-result-marker-color: #1fffd2; 27 | @syntax-result-marker-color-selected: #1fffd2; 28 | 29 | // Gutter colors 30 | @syntax-gutter-text-color: #61617b; 31 | @syntax-gutter-text-color-selected: #dbdbff; 32 | @syntax-gutter-background-color: #2e2e43; 33 | @syntax-gutter-background-color-selected: #34344a; 34 | 35 | // For git diff info. i.e. in the gutter 36 | @syntax-color-renamed: hsl(208, 100%, 60%); 37 | @syntax-color-added: hsl(150, 60%, 54%); 38 | @syntax-color-modified: hsl(40, 60%, 70%); 39 | @syntax-color-removed: hsl(0, 70%, 60%); 40 | 41 | // For language entity colors 42 | @syntax-color-variable: #1fffd2; 43 | @syntax-color-constant: #6cbeff; 44 | @syntax-color-property: #6cbeff; 45 | @syntax-color-value: #1fffd2; 46 | @syntax-color-function: #dbdbff; 47 | @syntax-color-method: #dbdbff; 48 | @syntax-color-class: #1fffd2; 49 | @syntax-color-keyword: #6cbeff; 50 | @syntax-color-tag: #dbdbff; 51 | @syntax-color-attribute: #8484a1; 52 | @syntax-color-import: #dbdbff; 53 | @syntax-color-snippet: #dbdbff; --------------------------------------------------------------------------------