Sha256: 903dc690fd300aa9c1d6e7051c42f6b98dde3aa0f53bc5e1a1b818645fb37147
Contents?: true
Size: 1.93 KB
Versions: 19
Compression:
Stored size: 1.93 KB
Contents
<% # 576 768 992 1200 # | | | | # BS4 xs | sm | md | lg | xl # BS3 xs | sm | md | lg # Docs: # BS4 : https://getbootstrap.com/docs/4.1/layout/overview/#responsive-breakpoints # BS3 : https://getbootstrap.com/docs/3.3/css/#grid # Basic idea is: default layout concerns desktop and tablet. # There is a small difference between 3 and 4 regarding tablets: # - BS4 treats tablets as desktop (expected behaviour) # - BS3 treats tablets as mobile (wrong behaviour for us) # Desktop size = component[:attributes].dig(:size, :value) offset = component[:attributes].dig(:offset, :value) classes = " col-lg-#{size} offset-lg-#{offset} col-lg-offset-#{offset}" # BS4 desktop+, BS3 desktop large # Tablet override # - md for BS4 # - sm for BS3 if component[:attributes].dig(:tablet, :value, :enabled, :value) size = component[:attributes].dig(:tablet, :value, :size, :value) offset = component[:attributes].dig(:tablet, :value, :offset, :value) classes += " col-md-#{size} col-md-offset-#{offset} offset-md-#{offset}" # BS4, breaks small desktop for BS3 classes += " col-sm-#{size} col-sm-offset-#{offset} offset-sm-#{offset}" # BS3, breaks mobile landscape for BS4 else # No tablet override classes += " col-md-#{size} offset-md-#{offset} col-md-offset-#{offset}" # BS4 tablet+, BS3 desktop only end # Mobile override # - no class for BS4 (xs disappears, sm is treated in the same way) # - xs for BS3 if component[:attributes].dig(:mobile, :value, :enabled, :value) size = component[:attributes].dig(:mobile, :value, :size, :value) offset = component[:attributes].dig(:mobile, :value, :offset, :value) classes += " col-#{size} offset-#{offset}" # BS4, does nothing for BS3 classes += " col-xs-#{size} col-xs-offset-#{offset}" # BS3, does nothing for BS4 end %> <div class="<%= classes %> <%= promethee_class_for component %>"> <%= render 'promethee/show/components', components: component[:children] %> </div>
Version data entries
19 entries across 19 versions & 1 rubygems