Skip to content

Commit 06e6230

Browse files
committed
Add full-width to base item lists
1 parent 5089bfb commit 06e6230

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

library/Kubernetes/Web/Controller.php

+18
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Icinga\Module\Kubernetes\Web;
66

7+
use Icinga\Module\Kubernetes\Common\BaseItemList;
8+
use ipl\Html\ValidHtml;
79
use ipl\Stdlib\Filter;
810
use ipl\Web\Compat\CompatController;
911
use ipl\Web\Filter\QueryString;
@@ -55,4 +57,20 @@ protected function getFilter(): Filter\Rule
5557

5658
return $this->filter;
5759
}
60+
61+
/**
62+
* Add the full-width class to the content element of BaseItemList instances.
63+
*
64+
* @param ValidHtml $content
65+
*
66+
* @return Controller
67+
*/
68+
protected function addContent(ValidHtml $content)
69+
{
70+
if ($content instanceof BaseItemList) {
71+
$this->content->getAttributes()->add('class', 'full-width');
72+
}
73+
74+
return parent::addContent($content);
75+
}
5876
}

public/css/module.less

+13
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,16 @@
128128
}
129129
}
130130

131+
.content.full-width {
132+
padding-left: 0;
133+
padding-right: 0;
134+
135+
.item-list .list-item {
136+
// The .list-item itself can't have padding because of `display:table-row`
137+
&:before, &:after {
138+
display: inline-block;
139+
content: '\00a0';
140+
width: 1em;
141+
}
142+
}
143+
}

0 commit comments

Comments
 (0)