Sha256: 9065701a9e63716a82520a6b34911190afda69a21925dfe6e60975edad24aa25

Contents?: true

Size: 529 Bytes

Versions: 10

Compression:

Stored size: 529 Bytes

Contents

# frozen_string_literal: true

module BootstrapEmail
  module Converter
    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

10 entries across 10 versions & 1 rubygems

Version Path
bootstrap-email-1.5.1 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.5.0 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.4.1 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.4.0 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.3.1 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.3.0 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.2.0 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.1.7 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.1.6 lib/bootstrap-email/converters/spacing.rb
bootstrap-email-1.1.5 lib/bootstrap-email/converters/spacing.rb