Liking cljdoc? Tell your friends :D

UniStyle › Usage › Base styles and preflight

Base styles and preflight

def-base

def-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.

Preflight

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

  1. Basics
  2. Utility reference
  3. Modifiers
  4. Transforms, transitions, and animations
  5. Themes and colors
  6. Components and variants
  7. Base styles and preflight
  8. Raw CSS
  9. Differences from Tailwind

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close