Add sticky utility

This commit is contained in:
Sebastian De Deyne 2017-11-07 23:55:32 +01:00
parent c94b62a505
commit 8537ceb7ce
3 changed files with 26 additions and 0 deletions

View File

@ -2192,6 +2192,10 @@ button,
position: relative;
}
.sticky {
position: sticky;
}
.pin-t {
top: 0;
}
@ -5152,6 +5156,10 @@ button,
position: relative;
}
.sm\:sticky {
position: sticky;
}
.sm\:pin-t {
top: 0;
}
@ -8113,6 +8121,10 @@ button,
position: relative;
}
.md\:sticky {
position: sticky;
}
.md\:pin-t {
top: 0;
}
@ -11074,6 +11086,10 @@ button,
position: relative;
}
.lg\:sticky {
position: sticky;
}
.lg\:pin-t {
top: 0;
}
@ -14035,6 +14051,10 @@ button,
position: relative;
}
.xl\:sticky {
position: sticky;
}
.xl\:pin-t {
top: 0;
}

View File

@ -46,6 +46,11 @@ title: "Positioning"
<td class="p-2 border-t border-smoke-light font-mono text-xs text-blue-dark">position: relative;</td>
<td class="p-2 border-t border-smoke-light text-sm text-grey-darker">Position an element according to the normal flow of the document.</td>
</tr>
<tr>
<td class="p-2 border-t border-smoke-light font-mono text-xs text-purple-dark">.sticky</td>
<td class="p-2 border-t border-smoke-light font-mono text-xs text-blue-dark">position: sticky;</td>
<td class="p-2 border-t border-smoke-light text-sm text-grey-darker">Position an element relative to the browser window when it's about to leave the viewport.</td>
</tr>
<tr>
<td class="p-2 border-t border-smoke-light font-mono text-xs text-purple-dark">.pin-t</td>
<td class="p-2 border-t border-smoke-light font-mono text-xs text-blue-dark">top: 0;</td>

View File

@ -6,6 +6,7 @@ export default function() {
fixed: { position: 'fixed' },
absolute: { position: 'absolute' },
relative: { position: 'relative' },
sticky: { position: 'sticky' },
'pin-t': { top: 0 },
'pin-r': { right: 0 },
'pin-b': { bottom: 0 },