Sha256: 76bae1da3cfe4ab5cbb2c5cc1fc037839bbc3234f2dc8552ff087b898c22ef06

Contents?: true

Size: 559 Bytes

Versions: 2

Compression:

Stored size: 559 Bytes

Contents

module Trestle
  module GridHelper
    def row
      content_tag(:div, class: "row") { yield }
    end

    def col(columns=nil, breakpoints={})
      if columns.is_a?(Hash)
        breakpoints = columns
        columns = breakpoints.delete("xs") || breakpoints.delete(:xs)
      end

      classes = []
      classes << (columns ? "col-#{columns}" : "col")
      classes += breakpoints.map { |breakpoint, span| "col-#{breakpoint}-#{span}" }

      content_tag(:div, class: classes) { yield }
    end

    def divider
      content_tag(:hr)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trestle-0.9.1 app/helpers/trestle/grid_helper.rb
trestle-0.9.0 app/helpers/trestle/grid_helper.rb