Enum Class TextUtils.Theme

java.lang.Object
java.lang.Enum<TextUtils.Theme>
co.mindus.utils.TextUtils.Theme
All Implemented Interfaces:
Serializable, Comparable<TextUtils.Theme>, Constable
Enclosing class:
TextUtils

public static enum TextUtils.Theme extends Enum<TextUtils.Theme>
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/&lt;name&gt;.css.

Themes are organized as three light/dark pairs plus a no-CSS option:

Document themes
ConstantBrightnessCSS FileDescription
NONENo CSS, bare HTML
BASICLightbasic.cssSystem fonts, minimal borders
BASIC_DARKDarkbasic-dark.cssMuted backgrounds, light text, subtle borders
MODERNLightmodern.cssInter font, refined spacing, soft shadows, accent colors
MODERN_DARKDarkmodern-dark.cssDeep slate, blue accents, glowing code blocks
GITHUBLightgithub.cssGitHub-inspired, rounded code blocks, alternating table rows
GITHUB_DARKDarkgithub-dark.cssDeep 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:
  • Enum Constant Details

    • NONE

      public static final TextUtils.Theme NONE
      No CSS — produces a bare HTML document.
    • BASIC

      public static final TextUtils.Theme BASIC
      Minimal, clean styling with system fonts and subtle borders.
    • BASIC_DARK

      public static final TextUtils.Theme BASIC_DARK
      Dark variant of BASIC: muted backgrounds, light text, subtle borders.
    • MODERN

      public static final TextUtils.Theme MODERN
      Contemporary light theme with refined spacing, soft shadows, and accent colors.
    • MODERN_DARK

      public static final TextUtils.Theme MODERN_DARK
      Dark variant of MODERN: deep slate backgrounds, blue accents, glowing code blocks.
    • GITHUB

      public static final TextUtils.Theme GITHUB
      Polished styling inspired by code-hosting platforms — rounded code blocks, alternating table rows, refined footnotes.
    • GITHUB_DARK

      public static final TextUtils.Theme GITHUB_DARK
      Dark variant of GITHUB: deep backgrounds, muted borders, blue-tinted accents.
  • Method Details

    • values

      public static TextUtils.Theme[] 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

      public static TextUtils.Theme valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getDisplayName

      public String getDisplayName()
      Returns the display name string of the theme.
    • getFilename

      public String getFilename()
      Returns a file-safe string for a document theme in e.g. CSS (e.g. "github-dark").
    • isLight

      public boolean isLight()
      Returns true if this is a light theme.
    • isDark

      public boolean isDark()
      Returns true if this is a dark theme.
    • resourcePath

      public String resourcePath()
      Returns the classpath resource path for this theme's CSS, or null for NONE.
    • toDark

      public TextUtils.Theme toDark()
      Returns the dark counterpart of a light theme, or itself if already dark/NONE.
    • toLight

      public TextUtils.Theme toLight()
      Returns the light counterpart of a dark theme, or itself if already light/NONE.