Breakout
Breakout
allows an item to break out of their containing element. To be honest, it’s just negative margins 😉.
-->
Breakout
allows an item to break out of their containing element. To be honest, it’s just negative margins 😉.
Breakout
lets the element break out of the container they are in. It uses negative margins to do this.
Use --breakout
to control the amount you wish to break out.
Breakout
works in 4 directions: top, bottom, left, and right. You can also use x
for inline breakout and y
for block breakout.
You can also use x
for inline breakout and y
for block breakout. For block breakouts, you need to ensure the element has sufficient height.
Breakout
lets you break out of the container. It uses negative margins.
The default breakout
amount is 1rem
. You can change it by changing the --breakout
variable. (Seriously, negative margins are probably easier).
You can use Breakout
to break out of 4 directions — top, bottom, left, and right. We have also added Breakout-x
and Breakout-y
to break out on the inline and block axis.
Class | Description |
---|---|
Breakout-x | Breaks out on the inline axis (left and right) |
Breakout-y | Breaks out on the block axis (top and bottom) |
Breakout-top | Breaks out on top |
Breakout-bottom | Breaks out on bottom |
Breakout-left | Breaks out on left |
Breakout-right | Breaks out on left |
Unfortunately, breakout
(and negative margins
) are unable to break out of elements with overflow
set to hidden
or scroll
.
The best way to break out of elements with overflow
is to move the element outside of the container.
Full breakouts (that reaches the ends of the external container, commonly the viewport) is possible — but they require a bit of work.
If you search around the internet, you will undoubtedly find this good old snippet below:
This snippet above works only if your content is centered.
If your content is not centered, you won’t be land a perfect breakout with almost any snippet you’ll find. The best way to breakout is through HTML — by placing the element outside of the container.
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.
Breakout
lets you break out of the container. It uses negative margins.
The default breakout
amount is 1rem
. You can change it by changing the --breakout
variable. (Seriously, negative margins are probably easier).
You can use Breakout
to break out of 4 directions — top, bottom, left, and right. We have also added Breakout-x
and Breakout-y
to break out on the inline and block axis.
Class | Description |
---|---|
Breakout-x | Breaks out on the inline axis (left and right) |
Breakout-y | Breaks out on the block axis (top and bottom) |
Breakout-top | Breaks out on top |
Breakout-bottom | Breaks out on bottom |
Breakout-left | Breaks out on left |
Breakout-right | Breaks out on left |
Unfortunately, breakout
(and negative margins
) are unable to break out of elements with overflow
set to hidden
or scroll
.
The best way to break out of elements with overflow
is to move the element outside of the container.
Full breakouts (that reaches the ends of the external container, commonly the viewport) is possible — but they require a bit of work.
If you search around the internet, you will undoubtedly find this good old snippet below:
This snippet above works only if your content is centered.
If your content is not centered, you won’t be land a perfect breakout with almost any snippet you’ll find. The best way to breakout is through HTML — by placing the element outside of the container.
Here’s the CSS for Breakout
.
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 Breakout
.
Class | Description |
---|---|
Breakout-x | Breaks out on the inline axis (left and right) |
Breakout-y | Breaks out on the block axis (top and bottom) |
Breakout-top | Breaks out on top |
Breakout-bottom | Breaks out on bottom |
Breakout-left | Breaks out on left |
Breakout-right | Breaks out on left |
Variable | Default | Description |
---|---|---|
--breakout | 1rem | Amount of negative margins to apply |
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 |
---|---|
Breakout-x | Breaks out on the inline axis (left and right) |
Breakout-y | Breaks out on the block axis (top and bottom) |
Breakout-top | Breaks out on top |
Breakout-bottom | Breaks out on bottom |
Breakout-left | Breaks out on left |
Breakout-right | Breaks out on left |
Variable | Default | Description |
---|---|---|
--breakout | 1rem | Amount of negative margins to apply |