Created
June 6, 2018 07:33
-
-
Save ViliamKopecky/37289938563223ec6370696b414e190c to your computer and use it in GitHub Desktop.
Custom overscroll colors for top and bottom sides of a page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=overscrolls($topColor, $bottomColor, $darken: 10%) | |
@if $topColor | |
body::before | |
content: '' | |
position: fixed | |
right: 0 | |
left: 0 | |
z-index: -1 | |
top: -50% | |
bottom: 50% | |
@if $darken | |
background: $topColor linear-gradient($topColor 50%, darken($topColor, $darken)) | |
@else | |
background: $topColor | |
@if $bottomColor | |
body::after | |
content: '' | |
position: fixed | |
right: 0 | |
left: 0 | |
z-index: -1 | |
top: 50% | |
bottom: -50% | |
@if $darken | |
background: $bottomColor linear-gradient(darken($bottomColor, $darken), $bottomColor 50%) | |
@else | |
background: $bottomColor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment