Enum Class TextUtils.Theme
- All Implemented Interfaces:
Serializable, Comparable<TextUtils.Theme>, Constable
- Enclosing class:
TextUtils
Available CSS themes for Markdown document rendering.
Each theme (except NONE) has a corresponding CSS file stored as a classpath resource at /co/mindus/utils/md/css/<name>.css.
Themes are organized as three light/dark pairs plus a no-CSS option:
| Constant | Brightness | CSS File | Description |
|---|---|---|---|
NONE | — | — | No CSS, bare HTML |
BASIC | Light | basic.css | System fonts, minimal borders |
BASIC_DARK | Dark | basic-dark.css | Muted backgrounds, light text, subtle borders |
MODERN | Light | modern.css | Inter font, refined spacing, soft shadows, accent colors |
MODERN_DARK | Dark | modern-dark.css | Deep slate, blue accents, glowing code blocks |
GITHUB | Light | github.css | GitHub-inspired, rounded code blocks, alternating table rows |
GITHUB_DARK | Dark | github-dark.css | Deep backgrounds, muted borders, blue-tinted accents |
Use toDark() and toLight() to switch between light/dark counterparts. The default theme for TextUtils.parseMarkdownToDocument(String) and the TextUtils.DocumentBuilder is GITHUB.
- Author:
- Christopher Mindus
- See Also:
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMinimal, clean styling with system fonts and subtle borders.Dark variant of BASIC: muted backgrounds, light text, subtle borders.Polished styling inspired by code-hosting platforms — rounded code blocks, alternating table rows, refined footnotes.Dark variant of GITHUB: deep backgrounds, muted borders, blue-tinted accents.Contemporary light theme with refined spacing, soft shadows, and accent colors.Dark variant of MODERN: deep slate backgrounds, blue accents, glowing code blocks.No CSS — produces a bare HTML document.Method Summary
Modifier and TypeMethodDescriptionReturns the display name string of the theme.Returns a file-safe string for a document theme in e.g.booleanisDark()Returnstrueif this is a dark theme.booleanisLight()Returnstrueif this is a light theme.Returns the classpath resource path for this theme's CSS, ornullfor NONE.toDark()Returns the dark counterpart of a light theme, or itself if already dark/NONE.toLight()Returns the light counterpart of a dark theme, or itself if already light/NONE.static TextUtils.ThemeReturns the enum constant of this class with the specified name.static TextUtils.Theme[]values()Returns an array containing the constants of this enum class, in the order they are declared.
Enum Constant Details
NONE
No CSS — produces a bare HTML document.BASIC
Minimal, clean styling with system fonts and subtle borders.BASIC_DARK
Dark variant of BASIC: muted backgrounds, light text, subtle borders.MODERN
Contemporary light theme with refined spacing, soft shadows, and accent colors.MODERN_DARK
Dark variant of MODERN: deep slate backgrounds, blue accents, glowing code blocks.GITHUB
Polished styling inspired by code-hosting platforms — rounded code blocks, alternating table rows, refined footnotes.GITHUB_DARK
Dark variant of GITHUB: deep backgrounds, muted borders, blue-tinted accents.
Method Details
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
getDisplayName
Returns the display name string of the theme.getFilename
Returns a file-safe string for a document theme in e.g. CSS (e.g."github-dark").isLight
public boolean isLight()Returnstrueif this is a light theme.isDark
public boolean isDark()Returnstrueif this is a dark theme.resourcePath
Returns the classpath resource path for this theme's CSS, ornullfor NONE.toDark
Returns the dark counterpart of a light theme, or itself if already dark/NONE.toLight
Returns the light counterpart of a dark theme, or itself if already light/NONE.