A Rails gem that integrates the Less CSS preprocessor into the Rails 5+ asset pipeline.
Less-Rails is a Ruby gem that integrates the Less CSS preprocessor into the Rails asset pipeline. It allows developers to write stylesheets using Less syntax—like variables, mixins, and nested rules—while benefiting from Rails' asset compilation, caching, and dependency management. The gem handles `.less` file processing, import tracking, and provides asset helpers for seamless Rails asset referencing.
Rails developers who want to use the Less CSS preprocessor within their Rails applications, particularly those using Rails 5+ and the asset pipeline for stylesheet management.
Developers choose Less-Rails because it provides a native Rails experience for Less, with automatic Sprockets integration, dependency tracking for imports, and configuration flexibility. It eliminates manual setup and ensures Less works seamlessly with Rails' asset pipeline conventions.
:-1: :train: Less.js For Rails
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Processes .less files through Rails' Sprockets with dependency tracking and compression, eliminating manual setup as described in the asset pipeline integration feature.
@import statements automatically trigger recompilation when imported files change, improving development workflow via Sprockets hooks, as highlighted in the import hooks section.
Allows customization of Less parser options, compression, and load paths through Rails config, providing control over stylesheet processing per the configuration instructions.
Provides Less-compatible helpers like asset-url() for referencing Rails assets directly in stylesheets, simplifying asset management as detailed in the helpers section.
Requires an additional gem like therubyracer for JavaScript execution, adding deployment complexity and potential performance overhead, as warned in the installing section.
Less's built-in compression is minimal; the README admits recommending external tools like YUI compressor for better results, indicating a weakness in default output optimization.
Asset helpers are not available client-side, requiring ERB templates for dynamic rendering, which limits flexibility in some scenarios, as noted in the helpers section.