Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
d99ff902
Commit
d99ff902
authored
5 years ago
by
jahanzaibsuleman07
Committed by
XhmikosR
5 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Responsive sticky top (#29158)
parent
49469ca0
2 merge requests
!31948
Examples/Floating-labels: fix bad behavior with autofill
,
!30064
test
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scss/helpers/_position.scss
+12
-5
scss/helpers/_position.scss
site/content/docs/4.3/helpers/position.md
+11
-0
site/content/docs/4.3/helpers/position.md
with
23 additions
and
5 deletions
+23
-5
scss/helpers/_position.scss
+
12
-
5
View file @
d99ff902
...
@@ -18,10 +18,17 @@
...
@@ -18,10 +18,17 @@
z-index
:
$zindex-fixed
;
z-index
:
$zindex-fixed
;
}
}
.sticky-top
{
// Responsive sticky top
@supports
(
position
:
sticky
)
{
@supports
(
position
:
sticky
)
{
position
:
sticky
;
@each
$breakpoint
in
map-keys
(
$grid-breakpoints
)
{
top
:
0
;
@include
media-breakpoint-up
(
$breakpoint
)
{
z-index
:
$zindex-sticky
;
$infix
:
breakpoint-infix
(
$breakpoint
,
$grid-breakpoints
);
.sticky
#{
$infix
}
-top
{
position
:
sticky
;
top
:
0
;
z-index
:
$zindex-sticky
;
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
site/content/docs/4.3/helpers/position.md
+
11
-
0
View file @
d99ff902
...
@@ -31,3 +31,14 @@ Position an element at the top of the viewport, from edge to edge, but only afte
...
@@ -31,3 +31,14 @@ Position an element at the top of the viewport, from edge to edge, but only afte
{{
<
highlight
html
>
}}
{{
<
highlight
html
>
}}
<div
class=
"sticky-top"
>
...
</div>
<div
class=
"sticky-top"
>
...
</div>
{{
<
/
highlight
>
}}
{{
<
/
highlight
>
}}
## Responsive sticky top
Responsive variations also exist for
`.sticky-top`
utility.
{{
<
highlight
html
>
}}
<div
class=
"sticky-sm-top"
>
Stick to the top on viewports sized SM (small) or wider
</div>
<div
class=
"sticky-md-top"
>
Stick to the top on viewports sized MD (medium) or wider
</div>
<div
class=
"sticky-lg-top"
>
Stick to the top on viewports sized LG (large) or wider
</div>
<div
class=
"sticky-xl-top"
>
Stick to the top on viewports sized XL (extra-large) or wider
</div>
{{
<
/
highlight
>
}}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets