Skip to content

Commit

Permalink
Merge pull request #446 from helsingborg-stad/feat/fluid-grid-update
Browse files Browse the repository at this point in the history
feat: fluid grid update
  • Loading branch information
NiclasNorin authored Aug 29, 2024
2 parents 35283d4 + 12d873b commit 2ae67f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion source/php/Component/Group/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public function init()
extract($this->data);

if (!empty($fluidGrid)) {
$fluidGrid = is_numeric($fluidGrid) ? $fluidGrid : 3;
$this->data['containerAware'] = true;
$this->data['classList'][] = $this->getBaseClass('fluid-grid', true);
$this->data['classList'][] = $this->getBaseClass('fluid-grid-' . $fluidGrid, true);
}

if ($direction == "vertical") {
Expand All @@ -29,7 +31,7 @@ public function init()
}

if (!empty($gap)) {
$this->data['classList'][] = $this->getBaseClass('gap-' . $gap, true);
$this->data['classList'][] = $this->getBaseClass('gap-' . $gap, true);
}

if (!empty($alignItems)) {
Expand Down
4 changes: 2 additions & 2 deletions source/php/Component/Group/group.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"flexGrow": false,
"flexShrink": true,
"gap": "",
"fluidGrid": false,
"fluidGrid": null,
"columns": null
},
"description": {
Expand All @@ -23,7 +23,7 @@
"flexGrow": "Allow to grow the content within the group",
"flexShrink": "Allow to shrink the content within the group",
"gap": "A number between 1-10 that sets the gap between flexed elements.",
"fluidGrid": "Uses flexbox and media queries to determine amount of items per row.",
"fluidGrid": "Uses flexbox and media queries to determine amount of items per row. Can be a number between 1-4 which will determine the maximum amount of items per row.",
"columns": "Number of items per row. (number between 1-12)"
},
"view": "group.blade.php",
Expand Down

0 comments on commit 2ae67f8

Please sign in to comment.