Sha256: 47cb4d6da030ef090f86de938b8577231ceac37dc47ad2f3eec89806bd73fcf8

Contents?: true

Size: 832 Bytes

Versions: 67

Compression:

Stored size: 832 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbBackground
    class Background < Playbook::KitBase
      prop :background_color, type: Playbook::Props::Enum,
                              values: %w[gradient dark light white],
                              default: "light"
      prop :image_url

      prop :tag, type: Playbook::Props::Enum,
                 values: %w[h1 h2 h3 h4 h5 h6 p div span],
                 default: "div"


      def classname
        generate_classname("pb_background_kit", image_classname, background_color_classname, separator: " ")
      end

    private

      def image_classname
        image_url.present? ? "lazyload blur_up" : ""
      end

      def background_color_classname
        !image_url.present? ? "pb_background_color_#{background_color}" : ""
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
playbook_ui-9.10.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.9.0.alpha.inline1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.9.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.8.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.7.0.pre.alphawidth1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.7.0.pre.alpha.a11y.btn app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.7.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.6.1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.6.1.pre.deps1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.6.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.5.0.alpha.rs.downgrade app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.5.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.4.0.alpha.sisense app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.4.0.alpha.user.kit.bug app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.4.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.3.1.pre.alpha2 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.4.0.pre.alpha2 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.4.0.pre.alpha1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-9.3.1.pre.alpha1 app/pb_kits/playbook/pb_background/background.rb