(beautify css-string & [opts])Formats and syntax highlights a valid CSS string for Clojure/Babashka. Maintains exact alignment for layered values and left-justifies properties.
Options map supports: :indentation - Number of spaces for each level (default: 2) :align-values? - Left-justify values across the block (default: true) :theme - Map of syntax elements to color keywords (e.g., :properties :blue, :numbers :orange). Presets live in cssyes.themes (e.g., cssyes.themes/neutral) :color-variant - One of cssyes.core/color-variants, such as :extra-dark. Prefixes each base color in the theme, so :blue becomes :extra-dark-blue, in place of the variant sugar picks for the terminal's background. :supports-color - A supports-color :context map passed to sugar.core/styled, for mocking in tests
Example: (beautify-css ".btn { color: red; }" {:indentation 2})
Formats and syntax highlights a valid CSS string for Clojure/Babashka.
Maintains exact alignment for layered values and left-justifies properties.
Options map supports:
:indentation - Number of spaces for each level (default: 2)
:align-values? - Left-justify values across the block (default: true)
:theme - Map of syntax elements to color keywords
(e.g., :properties :blue, :numbers :orange).
Presets live in cssyes.themes
(e.g., cssyes.themes/neutral)
:color-variant - One of cssyes.core/color-variants, such as :extra-dark.
Prefixes each base color in the theme, so :blue becomes
:extra-dark-blue, in place of the variant sugar picks
for the terminal's background.
:supports-color - A supports-color :context map passed to
sugar.core/styled, for mocking in tests
Example:
(beautify-css ".btn { color: red; }" {:indentation 2})The values :color-variant takes. Each is a prefix of a sugar palette name, such as :dark in :dark-blue.
The values :color-variant takes. Each is a prefix of a sugar palette name, such as :dark in :dark-blue.
(print-css s)(print-css s opts)Themed printing with indentation. Returns nil.
Themed printing with indentation. Returns nil.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |