This specification is a work in progress (WIP). We recommend using this one for now.

§Dracula Syntax Highlighting Specification

Official syntax highlighting and design specification for the Dracula Theme ecosystem.

§Overview

Dracula is a comprehensive dark/light color scheme designed for code editors, terminal emulators, and applications across multiple platforms. The project delivers a unified visual experience that minimizes context switching and enhances productivity.

Available Variants:

  • Dracula Classic: Original dark theme (Dracula Theme);
  • Alucard Classic: Complementary light theme.

§Color Palette

Dracula Classic:

TokenHexRGBHSLUsage
Background#282A3640, 42, 54231°, 15%, 18%Main background
Current Line#6272A498, 114, 164225°, 27%, 51%Comments, disabled code
Selection#44475A68, 71, 90232°, 14%, 31%Text selection
Foreground#F8F8F2248, 248, 24260°, 30%, 96%Default text
Comment#6272A498, 114, 164225°, 27%, 51%Comments, disabled code
Red#FF5555255, 85, 850°, 100%, 67%Errors, warnings, deletion
Orange#FFB86C255, 184, 10831°, 100%, 71%Numbers, constants, booleans
Yellow#F1FA8C241, 250, 14065°, 92%, 76%Functions, methods
Green#50FA7B80, 250, 123135°, 94%, 65%Strings, inherited classes
Cyan#8BE9FD139, 233, 253191°, 97%, 77%Support functions, regex
Purple#BD93F9189, 147, 249265°, 89%, 78%Classes, types, variables
Pink#FF79C6255, 121, 198326°, 100%, 74%Keywords, storage types

Alucard Classic:

TokenHexRGBHSLUsage
Background#FFFBEB255, 251, 23548°, 100%, 96%Main background
Current Line#6C664B108, 102, 7549°, 18%, 36%Line highlight
Selection#CFCFDE207, 207, 222240°, 18%, 84%Text selection
Foreground#1F1F1F31, 31, 310°, 0%, 12%Default text
Comment#6C664B108, 102, 7549°, 18%, 36%Comments, disabled code
Red#CB3A2A203, 58, 426°, 66%, 48%Errors, warnings, deletion
Orange#A34D14163, 77, 2024°, 78%, 36%Numbers, constants, booleans
Yellow#846E15132, 110, 2148°, 73%, 30%Functions, methods
Green#14710A20, 113, 10114°, 84%, 24%Strings, inherited classes
Cyan#036A963, 106, 150198°, 96%, 30%Support functions, regex
Purple#644AC9100, 74, 201252°, 54%, 54%Classes, types, variables
Pink#A3144D163, 20, 77336°, 78%, 36%Keywords, storage types

§ANSI Color Palette

For terminal applications, Dracula also defines ANSI colors.

Dracula Classic:

ANSI TokenHex CodeRGB
AnsiBlack#21222C33, 34, 44
AnsiRed#FF5555255, 85, 85
AnsiGreen#50FA7B80, 250, 123
AnsiYellow#F1FA8C241, 250, 140
AnsiBlue#BD93F9189, 147, 249
AnsiMagenta#FF79C6255, 121, 198
AnsiCyan#8BE9FD139, 233, 253
AnsiWhite#F8F8F2248, 248, 242
AnsiBrightBlack#6272A498, 114, 164
AnsiBrightRed#FF6E6E255, 110, 110
AnsiBrightGreen#69FF94105, 255, 148
AnsiBrightYellow#FFFFA5255, 255, 165
AnsiBrightBlue#D6ACFF214, 172, 255
AnsiBrightMagenta#FF92DF255, 146, 223
AnsiBrightCyan#A4FFFF164, 255, 255
AnsiBrightWhite#FFFFFF255, 255, 255

Alucard Classic:

ANSI TokenHex CodeRGB
AnsiBlack#FFFBEB255, 251, 235
AnsiRed#CB3A2A203, 58, 42
AnsiGreen#14710A20, 113, 10
AnsiYellow#846E15132, 110, 21
AnsiBlue#644AC9100, 74, 201
AnsiMagenta#A3144D163, 20, 77
AnsiCyan#036A963, 106, 150
AnsiWhite#1F1F1F31, 31, 31
AnsiBrightBlack#6C664B108, 102, 75
AnsiBrightRed#D74C3D215, 76, 61
AnsiBrightGreen#198D0C25, 141, 12
AnsiBrightYellow#9E841A158, 132, 26
AnsiBrightBlue#7862D0120, 98, 208
AnsiBrightMagenta#BF185A191, 24, 90
AnsiBrightCyan#047FB44, 127, 180
AnsiBrightWhite#2C2B3144, 43, 49

§UI Color Palette

Dracula Classic:

ContextHexRGBHSL
Floating interactive elements#34374652, 55, 70225°, 15%, 24%
Background Lighter#42445066, 68, 80231°, 10%, 29%
Background Light#34374652, 55, 70225°, 15%, 24%
Background Dark#21222C33, 34, 44235°, 14%, 15%
Background Darker#191A2125, 26, 33232°, 14%, 11%

Alucard Classic:

ContextHexRGBHSL
Floating interactive elements#EFEDDC239, 237, 22054°, 37%, 90%
Background Lighter#ECE9DF236, 233, 22346°, 25%, 90%
Background Light#DEDCCF222, 220, 20752°, 19%, 84%
Background Dark#CECCC0206, 204, 19251°, 13%, 78%
Background Darker#BCBAB3188, 186, 17947°, 6%, 72%

§Functional Colors

UI-specific colors for interactive elements, borders, and indicators. Do not use in editor or terminal applications.

TokenHexRGBHSLUsage
Functional Red#DE5735222, 87, 5312°, 71%, 54%Critical actions, alerts
Functional Orange#A39514163, 149, 2054°, 78%, 36%Warnings, notifications
Functional Green#0891088, 145, 8120°, 90%, 30%Success states
Functional Cyan#0081D60, 129, 214204°, 100%, 42%Information, links
Functional Purple#815CD6129, 92, 214258°, 61%, 60%Focus indicators

§Syntax Highlighting Rules

§Token Classification

Following TextMate scoping conventions for consistent highlighting across editors.

§Primary Tokens

Keywords & StoragePink

  • Language Keywords: if, else, return, function, class;
  • Storage Modifiers: static, public, private, const, let, var;
  • Control Flow: try, catch, throw, break, continue.

Functions & MethodsYellow

  • Function Declarations and Calls;
  • Method Invocations;
  • Built-in Functions.

Classes & TypesPurple

  • Class Names and Constructors;
  • Type Annotations: int, string, boolean;
  • Interfaces and Enums;
  • Generic Type Parameters.

Strings & TextGreen

  • String Literals: "Dracula", 'Dracula', template;
  • Markup Text Content;
  • Attribute Values in HTML/XML;
  • Escape Sequences.

Numbers & ConstantsOrange

  • Numeric Literals: 42, 3.14, 0xFF, 1e5;
  • Boolean Values: true, false;
  • Language Constants: null, undefined, NaN.

CommentsComment

  • Single-Line: //, #, --;
  • Multi-Line: /* */, <!-- -->;
  • Documentation Blocks;
  • Annotations and Decorators.

Support & Built-insCyan

  • Built-in Classes and Functions;
  • Regular Expressions;
  • CSS Properties and Units;
  • HTML/XML Tag and Attribute Names;
  • Library Functions.

Variables & IdentifiersForeground

  • Variable Names and Parameters;
  • Object Properties;
  • Default Text Content.

Errors & WarningsRed

  • Syntax Errors;
  • Deprecated Code;
  • Invalid Tokens;
  • Diff Deletions.

§Styling Modifiers

  • Italic: Comments, type parameters, documentation;
  • Bold: Strong emphasis (use sparingly);
  • Underline: Links, misspelled words.

§Language-Specific Examples

§JavaScript/TypeScript

/**
 * @param {string} foo - Some string parameter.
// ^^^^^^ --------------------------------------- Pink
//        ^^^^^^^^ ------------------------------ Cyan Italic
//                 ^^^ -------------------------- Orange Italic
//                     >* ----------------------- Comment
 */

§CSS

/* Pink - White */
body {
  /* Cyan - Pink - Purple */
  background: #000;
}

/* Green - White */
#dracula {
  display: none;
  visibility: hidden;
  height: calc(var(--deathDate) - var(--birthDate));
  /* Cyan - Pink - Yellow */
  font-family: "Transylvania";
  /* Cyan - Pink - Purple */
  opacity: 0;
}

§Special Rules

  1. Braces and Parentheses: Should match the foreground color of the currently scoped position:

    • Purple for headings;
    • Foreground for regular text.
  2. Instance Reserved Words: Words that interact with the instance (this, self, super) should be highlighted consistently;

  3. Generic Templates: Generic type declarations should use Orange Italic.

§Implementation Guidelines

§Accessibility Standards

  • Maintain 4.5:1 minimum contrast ratio (WCAG 2.1 Level AA);
  • Ensure color is not the sole means of conveying information;
  • Test with common color vision deficiencies.

§Consistency Requirements

  1. Priority Order: Follow token classification hierarchy;
  2. Fallback Handling: Use foreground color for unrecognized tokens;
  3. Semantic Consistency: Same meaning = same color across languages;
  4. Reference Implementation: dracula/cursor.

§Testing Methodology

Use the standard test snippet to validate implementations:

/**
 * Once upon a time...
 */
class Vampire {
  constructor(props) {
    this.location = props.location;
    this.birthDate = props.birthDate;
    this.deathDate = props.deathDate;
    this.weaknesses = props.weaknesses;
  }

  get age() {
    return this.calcAge();
  }

  calcAge() {
    return this.deathDate - this.birthDate;
  }
}

// ...there was a guy named Vlad
const Dracula = new Vampire({
  location: "Transylvania",
  birthDate: 1428,
  deathDate: 1476,
  weaknesses: ["Sunlight", "Garlic"]
});

Our official Template for submissions includes a sample folder containing numerous code examples in various languages to assist with theme development.

§UI Design Guidelines

§Visual Hierarchy

Apply colors based on functional importance and user interaction patterns:

  • High Priority: Interactive elements, errors, primary actions;
  • Medium Priority: Secondary content, navigation, labels;
  • Low Priority: Decorative elements, dividers, backgrounds.

§Component Guidelines

Borders and Separators

  • Subtle borders: Use Current Line color;
  • Interactive borders: Use functional colors;
  • Focus rings: Functional Purple or appropriate accent.

Shadows and Depth

  • Shadow color should harmonize with background;
  • Avoid shadows darker than supporting surface;
  • Use elevation sparingly to maintain theme coherence.

State Indicators

  • Success: Functional Green;
  • Warning: Functional Orange;
  • Error: Functional Red;
  • Info: Functional Cyan.

§Community and Maintenance

Core Team:

Special thanks to Derek Sifford, creator of the first version of this specification on May 28, 2017.

Resources:

§Contributing

"We learn big things from small experiences" - Bram Stoker

Dracula Theme is an open-source project driven by and for the community. Most apps that support the theme are contributions from our community.

As much as the team is responsible for the core theme and wants to support all available applications, we can only do some of it ourselves.

That's why the community is essential for this project to keep evolving.

§Creating New Implementations

  1. Fork the template repository

    git clone https://github.com/dracula/template.git
    
  2. Follow the specification

    • Use exact color values from this specification;
    • Implement syntax highlighting rules consistently;
    • Test with provided code samples.
  3. Submit for review

    • The repository must contain the following files, as in the template:
      • README.md: introduction and guide for GitHub users;
      • screenshot.png: displays your Dracula-themed theme on the website;
      • INSTALL.md: installation instructions to display on the website;
      • sample: code samples in various languages to aid theme creation. (Consider removing this folder before submission.);
    • Submit an issue with repository link.
  4. Organization transfer

    • Accepted repositories move under Dracula organization;
    • Maintain consistency with other official implementations.

§Quality Standards

  • Color Accuracy: Use exact hex values from specification;
  • Coverage: Support all major syntax categories;
  • Documentation: Clear installation and usage instructions;
  • Testing: Validate against multiple code samples;
  • Maintenance: Respond to issues and keep updated.

This specification is the authoritative reference for Dracula Theme implementations. For updates and community resources, visit draculatheme.com.

See something that could be improved in this documentation? Contribute by editing this page on GitHub.