To change the colors of your code elements, edit the properties of the selectors in the main.less file.
However, before you jump into modifying the selectors in main.less file, it is important to know what the different selectors mean, and the code elements they impact. Review the following table to understand the code elements in HTML, CSS, JavaScript, and PHP files that are impacted by these selectors.
You can also use the
Token Inspector
to understand the code elements that are impacted by a particular selector.
.cm-atom
Entity names such as
Color in hexadecimal, RGB, or HSL format, predefined attribute values such as strong, none, auto, inherit, and so on.
true, false, null, undefined, NaN, Infinity
True, False, Null and magic constants such as __LINE__, __DIR__, and so on
.cm-attribute
Attribute Name
Media types such as all, braille, print, screen, and so on
.cm-bracket
Tag brackets such as <, >, /> and </
.cm-builtin
ID selector
Built-in functions such as htmlspecialchars, trim, substr, and so on
.cm-comment
Comment
Comment
Comment
Comments
.cm-def
"@ rule"
variable, function definition and function parameter
The function name in function definition
.cm-error
Closing tags without a starting tag
Missing a quotation for a attribute value
Error because of missing { or } brackets or missing quotes for a property value or unrecognized property
.cm-keyword
Color names, !important, keywords in @media like and, only, and so on.
Control structure keywords (if, else, …), in, of, from, default, public, private, and so on
Keywords like function, if, else, new, echo, isset, and so on
.cm-meta
<!DOCTYPE> Declaration
Browser specific prefixes such as -webkit-, -o-, and so on
Ellipsis in spread syntax. Example: myFunction(...iterableObj);
<!DOCTYPE> Decleration and PHP start and end tags: <?php, ?>
.cm-number
Any number with or without a unit
Any number like 12, 2.1, 123e-5, 0x11, 0b11, 0o11, and so on
Any number like 12, 2.1, 0x11, 0b11, 0123, 5.0E+19, and so on.
.cm-operator
Operators: +, -, *, +=, !==, &&, >>>, and so on
Operators like ===, &&, !, =>, +, -, and so on
.cm-property
Property name
Object property or method
.cm-qualifier
Class selector
.cm-string
attribute value
Regular string, like one passed to a url() call, font name within quotes, and so on.
Literal string
Literal string
.cm-string-2
Non standard properties like scrollbar-arrow-color, scrollbar-base-color, and so on.
Regular expressions
.cm-tag
Tag name
Tag selector
.cm-variable
Font names without quotes
Global variables/functions, class references
User defined function names, interface/class references, class properties, casts,
.cm-variable-2
Custom properties such as main-bg-color
Scoped variables/functions references
User defined and predefined variables, parameters or attributes
.cm-variable-3
Pseudo-classes such as :hover, and :focus, and pseudo-elements such as ::first-letter, ::selection, and so on
Change the mode of the file by typing in the filename extension and clicking
Change mode
.
For example, if it is an HTML file, then change the filename extension to html. The page updates to reflect the change in mode and states the current mode at the top of the page.