Sha256: 90fb4f4cfe0457f96acb61ad1ac5e57c180f025bbecbd0adfc492360ee141bce

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

module BootstrapEmail
  module Component
    class Spacing < Base
      def build
        each_node('*[class*=space-y-]') do |node|
          spacer = node['class'].scan(/space-y-((lg-)?\d+)/)[0][0]
          # get all direct children except the first
          node.xpath('./*[position() < last()] | ./tbody/tr/td/*[position() < last()]').each do |child|
            next if margin_bottom?(child)

            add_class(child, "mb-#{spacer}")
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bootstrap-email-1.0.0.alpha2.1 lib/bootstrap-email/components/spacing.rb
bootstrap-email-1.0.0.alpha2 lib/bootstrap-email/components/spacing.rb