Sha256: 834a1c52d2439d34c363026be855cec1ecbf9d568af1cde37fd371452448088d
Contents?: true
Size: 593 Bytes
Versions: 12
Compression:
Stored size: 593 Bytes
Contents
module Coprl::Presenters::WebClient::Helpers module Color def color_classname(comp, affects = nil, color_attr = :color) color = comp&.public_send(color_attr) return unless color return "v-#{comp.type}__primary" if eq(color, :primary) return "v-#{comp.type}__secondary" if eq(color, :secondary) "v-#{affects}color__#{color}" end def color_style(comp, affects = nil, color_attr = :color) color = comp.public_send(color_attr) "#{affects}color: #{color};" unless %w(primary secondary).include?(color.to_s) || color.nil? end end end
Version data entries
12 entries across 12 versions & 1 rubygems