Sha256: f58b19597c858620008af5280a5763dd4c61e60dcb49248fa207488c63546be7
Contents?: true
Size: 580 Bytes
Versions: 29
Compression:
Stored size: 580 Bytes
Contents
module Coco class Spacer < Coco::Component include Concerns::AcceptsOptions SIZES = [0, 1, 2, 3, 4, 5, 6, 7, 8] BREAKPOINTS = %i[sm md lg xl] DEFAULT = 4 accepts_option :size, from: SIZES, default: DEFAULT accepts_option :scale_from, from: BREAKPOINTS, private: true accepts_option :responsive, from: [true, false], default: true, private: true def call render component_tag(:div, data: {scale_from:}) end def scale_from get_option_value(:responsive) ? get_option_value(:scale_from) : BREAKPOINTS.last end end end
Version data entries
29 entries across 29 versions & 1 rubygems