Sha256: ef2de2657eceaebfeaac66406a79eeb6f0af3318b4bb399c860769d75da4fb02
Contents?: true
Size: 712 Bytes
Versions: 20
Compression:
Stored size: 712 Bytes
Contents
# frozen_string_literal: true module Proscenium::CssModule extend ActiveSupport::Autoload autoload :Path autoload :Transformer class TransformError < StandardError def initialize(name, additional_msg = nil) msg = "Failed to transform CSS module `#{name}`" msg << ' - ' << additional_msg if additional_msg super msg end end # Accepts one or more CSS class names, and transforms them into CSS module names. # # @param name [String,Symbol,Array<String,Symbol>] def css_module(*names) cssm.class_names(*names, require_prefix: false).map { |name, _| name }.join(' ') end private def cssm @cssm ||= Transformer.new(self.class.css_module_path) end end
Version data entries
20 entries across 20 versions & 1 rubygems