Class: BulmaPhlex::Columns
- Inherits:
-
Base
- Object
- Base
- BulmaPhlex::Columns
- Defined in:
- lib/bulma_phlex/columns.rb
Overview
Renders a responsive column layout using Bulma's column system.
Supports options for breakpoint, alignment (centered, vertically centered), layout (multiline, gap sizing), and responsive gap configuration per breakpoint.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(minimum_breakpoint: nil, multiline: false, gap: nil, centered: false, vcentered: false, **html_attributes) ⇒ Columns
constructor
A new instance of Columns.
- #view_template ⇒ Object
Constructor Details
#initialize(minimum_breakpoint: nil, multiline: false, gap: nil, centered: false, vcentered: false, **html_attributes) ⇒ Columns
Returns a new instance of Columns.
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/bulma_phlex/columns.rb', line 27 def initialize(minimum_breakpoint: nil, multiline: false, gap: nil, centered: false, vcentered: false, **html_attributes) @minimum_breakpoint = minimum_breakpoint @multiline = multiline @gap = gap @centered = centered @vcentered = vcentered @html_attributes = html_attributes end |
Class Method Details
.new(minimum_breakpoint: nil, multiline: false, gap: nil, centered: false, vcentered: false, **html_attributes) ⇒ Object
Parameters
minimum_breakpoint— Sets the minimum breakpoint for the columns (e.g.:tablet,:desktop)multiline— Iftrue, allows the columns to wrap onto multiple linesgap— An integer (0-8) to set the gap size, or a hash keyed by breakpoints for responsive gapscentered— Iftrue, centers the columnsvcentered— Iftrue, vertically centers the columns**html_attributes— Additional HTML attributes for the columns container
18 19 20 21 22 23 24 25 |
# File 'lib/bulma_phlex/columns.rb', line 18 def self.new(minimum_breakpoint: nil, multiline: false, gap: nil, centered: false, vcentered: false, **html_attributes) super end |
Instance Method Details
#view_template ⇒ Object
41 42 43 |
# File 'lib/bulma_phlex/columns.rb', line 41 def view_template(&) div(**mix({ class: columns_classes }, @html_attributes), &) end |