Sha256: d527ed4f74e3927718aaaad3576d3f6fe402ed2558ad66efdba97cfa594b627a
Contents?: true
Size: 984 Bytes
Versions: 11
Compression:
Stored size: 984 Bytes
Contents
# frozen_string_literal: true module Playbook module PbImage class Image < Playbook::KitBase prop :alt prop :on_error, type: Playbook::Props::String, default: nil prop :rounded, type: Playbook::Props::Boolean, default: false prop :size, type: Playbook::Props::Enum, values: %w[xs sm md lg xl none], default: "none" prop :transition, type: Playbook::Props::Enum, values: %w[blur fade scale none], default: "fade" prop :url def classname generate_classname("pb_image_kit#{size_class} #{transition_class} lazyload") + rounded_class end private def rounded_class rounded ? " rounded" : "" end def size_class size == "none" ? nil : "_#{size}" end def transition_class transition == "none" ? nil : transition end end end end
Version data entries
11 entries across 11 versions & 1 rubygems