BetterDiscord themes follow a specific structure to ensure proper loading and functionality.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/betterdiscord/betterdiscord/llms.txt
Use this file to discover all available pages before exploring further.
Basic structure
A theme file consists of two main parts:- Metadata block - JSDoc comment with theme information
- CSS content - Your actual styles
File naming
Themes must use the.theme.css extension:
- ✅
MyTheme.theme.css - ✅
dark-mode.theme.css - ❌
MyTheme.css- Will not be recognized - ❌
MyTheme.theme.txt- Wrong extension
MyTheme (1).theme.css).
Metadata format
The metadata block uses JSDoc syntax and must appear at the very beginning of the file:Required fields
These fields are required for a valid theme:@name- Theme display name@author- Your name or username@version- Semantic version number@description- Brief description of the theme
Optional fields
These fields provide additional information:@source- GitHub or GitLab repository URL@website- Theme homepage or documentation@invite- Discord server invite for support@donate- Donation link (Ko-fi, PayPal, etc.)@patreon- Patreon page@authorId- Your Discord user ID@authorLink- Personal website or portfolio
Custom properties
Themes can define custom CSS properties that BetterDiscord recognizes for advanced configuration:File organization
For complex themes, consider organizing your code:Theme imports
You can import external stylesheets, but use caution as they may fail if the external source is unavailable:Theme loading process
Understanding how BetterDiscord loads themes helps you debug issues:- File detection - BetterDiscord scans the themes folder for
.theme.cssfiles - Metadata parsing - Extracts the JSDoc metadata block
- Validation - Ensures required fields (name, author, version, description) are present
- CSS extraction - Reads the CSS content after the metadata
- Property extraction - Identifies
@propertydeclarations for future use - Injection - Injects the CSS into a
<style>element in the<head>
{slug}-theme-container, where slug is the filename without the extension and spaces replaced with hyphens.
Error handling
If your theme fails to load, check for:- Missing or incomplete metadata block
- Invalid JSDoc syntax
- Missing required fields
- UTF-8 BOM (Byte Order Mark) at file start - BetterDiscord strips this automatically
Hot reload
BetterDiscord watches theme files for changes:Next steps
Styling guide
Learn about Discord’s CSS variables and selectors
Best practices
Follow guidelines for high-quality themes