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-8.3.0.pre.alpha1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.2.1.pre.alpha1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.2.1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.1.3 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.4.0.alpha.dependencies.2 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.4.0.alpha.dependencies.1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.2.0.pre.alpha4 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.2.0.pre.alpha3 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.2.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.1.2 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.1.0.pre.alpha1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.0.3 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.2.0.pre.alpha2 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.1.1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.0.2 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.2.0.pre.alpha1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.1.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.0.1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.0.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-8.0.0.pre.alpha5 app/pb_kits/playbook/pb_background/background.rb