Sha256: 64009efa94d8e6c047cea708ca3799d36db2a7f29a3c09bf9d7a86ba81895735
Contents?: true
Size: 1.05 KB
Versions: 525
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true module Playbook module VerticalAlign def self.included(base) base.prop :vertical_align end # rubocop:disable Style/IfInsideElse def vertical_align_props selected_props = vertical_align_options.keys.select { |sk| try(sk) } return nil unless selected_props.present? selected_props.map do |k| vertical_align_value = send(k) if vertical_align_value.is_a?(Hash) vertical_align_value.map do |media_size, flex_value| "vertical_align_#{media_size}_#{flex_value.underscore}" if vertical_align_values.include? flex_value end else "vertical_align_#{vertical_align_value.underscore}" if vertical_align_values.include? vertical_align_value end end.compact.join(" ") end # rubocop:enable Style/IfInsideElse def vertical_align_options { vertical_align: "vertical_align", } end def vertical_align_values %w[baseline super top middle bottom sub text-top text-bottom] end end end
Version data entries
525 entries across 525 versions & 1 rubygems