Sha256: 78b8e32999e20695c14ea02c6e2bb9c2631804d974343052b775c1ef8ca84050
Contents?: true
Size: 503 Bytes
Versions: 9
Compression:
Stored size: 503 Bytes
Contents
# frozen_string_literal: true class Proscenium::CssModule def initialize(path) @path = "#{path}.module.css" return unless Rails.application.config.proscenium.side_load Proscenium::SideLoad.append! Rails.root.join(@path) end # Returns an Array of class names generated from the given CSS module `names`. def class_names(*names) names.flatten.compact.map { |name| "#{name}#{hash}" } end private def hash @hash ||= Digest::SHA1.hexdigest("/#{@path}")[..7] end end
Version data entries
9 entries across 9 versions & 1 rubygems