I dug around an hour, sure I'd find this, tho i didn't. It is small, tho it would help responsive layout. In my case, I have a nav sidebar, fixed when 'lg' and 'sm', but i need to make it display as block on tablets and phones.
Thank you.
<header class="position-fixed[-md-up|-md-lg-xl]">
<nav>
</nav>
</header>
To get it more into Bootstrap philosophy I would more likely do p-[breakpoint]-[value], see Display Property.
_utilities/_position.scss_:
$positions: static, relative, absolute, fixed, sticky;
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@each $value in $positions {
.p#{$infix}-#{$value} {
position: $value !important;
}
}
}
}
In v5 you will be able to use our build in utility API:
$utilities: (
"position": (
property: position,
responsive: true,
values: static relative absolute fixed sticky
),
);
Which will generate classes like .position-md-fixed or .position-sm-relative.
Most helpful comment
In
v5you will be able to use our build in utility API:Which will generate classes like
.position-md-fixedor.position-sm-relative.