Download the PHP package digitaledinge/contao-grid-ratio-widget without Composer
On this page you can find all versions of the php package digitaledinge/contao-grid-ratio-widget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digitaledinge/contao-grid-ratio-widget
More information about digitaledinge/contao-grid-ratio-widget
Files in digitaledinge/contao-grid-ratio-widget
Package contao-grid-ratio-widget
Short Description Grid ratio widget for Contao Open Source CMS
License MIT
Informations about the package contao-grid-ratio-widget
Contao Grid Ratio Widget
Description
Adds a backend widget to define uneven grid column ratios for element groups.
The editor sets a column count (2–4) and drags a ruler to split the width; the
value is stored as a ready-to-use fr list (e.g. 4fr 8fr) and rendered as the
inline custom property --grid-cols on the group wrapper.
The widget is framework-independent (e.g. no Tailwind) and self-contained:
Installing the bundle adds the field to the element_group content element and ships the matching frontend grid CSS.
How it works
- Backend: an "Erweitertes Spaltenset" checkbox reveals the ratio field
(sub-palette). The ruler snaps to twelfths, so 2/3/4 columns can be split
evenly and in exact thirds/quarters. Percentages are shown;
fris stored. - Frontend: the bundle wraps the nested elements in
<div class="grid-ratio" style="--grid-cols: 4fr 8fr">and shipsgrid-ratioCSS (grid-template-columns: var(--grid-cols), stacked on mobile).
Installation
Customization
The grid-ratio behavior is split into overridable Twig blocks, so you can switch parts off or reuse them elsewhere.
Resets
Using within your template
To apply a stored value to your own element, add the attributes that will inject the --grid-cols variable in your CSS:
All versions of contao-grid-ratio-widget with dependencies
contao/core-bundle Version ^5.7 || ^6.0
symfony/asset Version ^7.4 || ^8.1
symfony/http-kernel Version ^7.4 || ^8.1
symfony/dependency-injection Version ^7.4 || ^8.1
symfony/event-dispatcher Version ^7.4 || ^8.1