Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. ClojureScript
  3. stylefy

stylefy

MITClojure3.2.0

A Clojure(Script) library for styling UI components using Clojure data structures, with automatic CSS generation and scoped classes.

GitHubGitHub
321 stars11 forks0 contributors

What is stylefy?

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.

Target Audience

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.

Value Proposition

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.

Overview

Clojure(Script) library for styling user interface components.

Use Cases

Best For

  • Styling Reagent or Rum components with Clojure data maps
  • Building isomorphic ClojureScript applications with server-side rendered styles
  • Managing complex UI styles without writing CSS selectors
  • Creating responsive designs with inline media queries in style maps
  • Implementing pseudo-classes (e.g., :hover) directly in Clojure styles
  • Caching generated CSS for faster frontend reloads

Not Ideal For

  • Teams building new ClojureScript applications with modern UI frameworks that have native styling solutions
  • Projects requiring active library maintenance and frequent updates for compatibility with newer Clojure versions
  • Developers needing plug-and-play styling with zero configuration or minimal setup overhead
  • Applications where synchronous style application is critical, to avoid brief visibility hides during async DOM updates

Pros & Cons

Pros

Data-Driven Style Definitions

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.

Automatic Scoped CSS

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.

Full CSS Feature Support

Supports pseudo-classes (modes), media queries, feature queries, and vendor prefixes directly within style maps, allowing responsive designs without external CSS files.

Server-Side Rendering

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.

Cons

Legacy Project Status

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.

Complex Initial Setup

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.

Asynchronous DOM Updates

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.

Frequently Asked Questions

Quick Stats

Stars321
Forks11
Contributors0
Open Issues11
Last commit1 year ago
CreatedSince 2017

Tags

#clojurescript#reagent#ui#frontend#ui-components#clojure#rum#ui-styling#component-styling#css-in-js#css

Built With

C
Clojure
C
ClojureScript

Included in

ClojureScript1.1k
Auto-fetched 14 hours ago

Related Projects

GardenGarden

Generate CSS with Clojure

Stars1,365
Forks94
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub