Closed timoconnellaus closed 1 month ago
You can leave width
and height
as undefined
and make the parent component have display: grid
.
It works because:
width
and height
set to undefined
mean that in CSS they're gonna be auto
.auto
fills the parent if the parent uses grid layout.For many reasons Easyblocks prefers grid
/flex
over width: 100%
/ height: 100%
styling. When I have a free moment I'll add a note to the docs about that because it's a recurring question and is not easy to explain quickly.
That being said, the idea of providing custom component for Placeholder is a very good one!
Thank you. That worked perfectly
Motiviation: the placeholder is currently pretty rigid with the ability to set height, width or aspect ratio. But when the parent container's shape is dynamic it's not possible to automatically grow / shrink the placeholder to fill the parent
Solution: ability to pass class names to the component - this allows for tailwind to be used to style the placeholder
Perhaps this could even be expanded to completely replace the placeholders styling