UniStyle › Usage › Base styles and preflight
def-basedef-base registers utility declarations in the base cascade layer against
an arbitrary CSS selector. The selector must be a compile-time string. Use it
for global styles such as resets where no generated class can be attached to an
element:
(s/def-base "html, body"
(s/m 0)
(s/p 0))
It has no options. Utilities, modifiers, and previously composed classes can be used as rules.
uni.style.preflight/import-preflight registers the same browser reset as
Tailwind Preflight in the base layer using def-base. It accepts optional
sans and monospace font configuration:
(ns example.styles
(:require [uni.style.preflight :as s.preflight]))
(s.preflight/import-preflight
{:font-family "Inter"
:font-feature-settings "normal"
:font-variation-settings "normal"
:mono-font-family "Berkeley Mono"
:mono-font-feature-settings "normal"
:mono-font-variation-settings "normal"})
The family options default to nil, which leaves only Preflight's system
fallback stacks. All feature and variation settings default to "normal".
Preflight uses raw for browser-compatibility declarations that do not have a
uni.style utility.
Next: Raw CSS →
Usage
Can you improve this documentation?Edit on GitHub
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 |