Stack
Stack
creates elements that are stacked on top of each other with CSS Grid.
-->
Stack
creates elements that are stacked on top of each other with CSS Grid.
Stack
uses CSS Grid to stack elements together.
If one layer has more content than others, the entire stack expands in accordance to that layer.
This becomes super easy and doable because Stack
elements contains the same height
and width
.
Backgrounds are also automatically contained within the stack — no overflow headaches!
This example uses Edge
to position the pills on
the Foreground
.
Stack
lets you stack elements on top of each other. It is useful for creating overlapping layers (very much like having layers in Photoshop or other design applications).
When combined with Positioning classes like Edge
, Stack
lets you create complex layouts with backgrounds, content, and foregrounds easily.
Stack
uses CSS Grid that has one column and one row. Everything is placed in that column and row.
In this example below, you won’t be able to see One
because Two
is placed
on top of it. But if we add some opacity to Two
, you can see that it
overlaps with One
.
You can have an unlimited number of layers in a Stack
. The order of layers are determined by two factors:
Background
or Foreground
classBackgrounds
will always be placed at the bottom of the stack, while Foregrounds
will always be placed at the top.
Background
layers let you add misellaneous design items beyond what a standard background
property could achieve — so you can do more than just colours and gradients.
One example of what you can do is SVG Backgrounds. To make beautiful SVG backgrounds, you can use SVG patterns from Pattern Monster, Hero Patterns and many others.
You can go even more nuts with this, but we won’t do that here.
Foreground
layers let you place elements before the content. This is useful for placing elements like badges, labels, or other elements that should be on top of the content.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
Stack
lets you stack elements on top of each other. It is useful for creating overlapping layers (very much like having layers in Photoshop or other design applications).
When combined with Positioning classes like Edge
, Stack
lets you create complex layouts with backgrounds, content, and foregrounds easily.
Stack
uses CSS Grid that has one column and one row. Everything is placed in that column and row.
In this example below, you won’t be able to see One
because Two
is placed
on top of it. But if we add some opacity to Two
, you can see that it
overlaps with One
.
You can have an unlimited number of layers in a Stack
. The order of layers are determined by two factors:
Background
or Foreground
classBackgrounds
will always be placed at the bottom of the stack, while Foregrounds
will always be placed at the top.
Background
layers let you add misellaneous design items beyond what a standard background
property could achieve — so you can do more than just colours and gradients.
One example of what you can do is SVG Backgrounds. To make beautiful SVG backgrounds, you can use SVG patterns from Pattern Monster, Hero Patterns and many others.
You can go even more nuts with this, but we won’t do that here.
Foreground
layers let you place elements before the content. This is useful for placing elements like badges, labels, or other elements that should be on top of the content.
Here’s the CSS for Stack
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
Here’s the CSS for Stack
.
The astro-island
and astro-slot
selectors help to alleviate styling frustrations when using Astro.
Class | Description |
---|---|
Background | Background layer. |
* | Unnamed layer. Placed above Background layer |
Foreground | Foreground layer. Placed above other layers |
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
Class | Description |
---|---|
Background | Background layer. |
* | Unnamed layer. Placed above Background layer |
Foreground | Foreground layer. Placed above other layers |