A Clojure(Script) library for styling UI components using Clojure data structures, with automatic CSS generation and scoped classes.
stylefy is a Clojure and ClojureScript library for styling user interface components using Clojure data structures. It solves the problem of managing CSS selectors and class names by automatically converting style maps to scoped CSS classes at runtime, providing a seamless way to style components without writing traditional CSS.
Clojure and ClojureScript developers building web applications with UI libraries like Reagent or Rum, who prefer a data-driven approach to styling and want to avoid CSS selector complexity.
Developers choose stylefy for its elegant integration with Clojure's data-oriented paradigm, offering full CSS feature support (including media queries and pseudo-classes) without the overhead of manual CSS class management, while enabling server-side rendering and style caching.
Clojure(Script) library for styling user interface components.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Styles are defined as Clojure maps, enabling easy composition, parameterization, and reuse, as demonstrated in the README with examples like merging styles and function-based generation.
Converts style maps to unique, scoped CSS classes at runtime via Garden, eliminating manual CSS selector management and preventing style conflicts in component-based apps.
Supports pseudo-classes (modes), media queries, feature queries, and vendor prefixes directly within style maps, allowing responsive designs without external CSS files.
Provides stylefy/query-with-styles for backend style generation, facilitating isomorphic applications with consistent styling across server and client, as outlined in the backend setup.
The README explicitly states it's built for a previous era of Clojure & CSS and recommends choosing a different library, indicating limited maintenance and future support.
Requires manual insertion of style tags, initialization with specific UI modules (e.g., Reagent or Rum), and additional steps for multi-instance support or caching, increasing setup overhead.
Styles are added asynchronously by default, which can cause elements to be briefly hidden with visibility: hidden, requiring workarounds like prepare-style for synchronous updates, potentially impacting performance.