fix: overflow on 320px screens

This commit is contained in:
atomiks
2018-03-03 19:03:38 +10:00
parent 7250a9adfa
commit 7f2638cd38
4 changed files with 34 additions and 34 deletions

View File

@ -1025,7 +1025,7 @@ var y = e.pageY - btn.offsetTop - btn.offsetParent.offsetTop
content: '';
position: absolute;
bottom: 0;
width: 300px;
width: 240px;
height: 25px;
background: linear-gradient(
rgba(255, 255, 255, 0.001),
@ -1036,8 +1036,8 @@ var y = e.pageY - btn.offsetTop - btn.offsetParent.offsetTop
.overflow-scroll-gradient__scroller {
overflow-y: scroll;
background: white;
width: 300px;
height: 250px;
width: 240px;
height: 200px;
padding: 15px 0;
line-height: 1.2;
text-align: center;
@ -1059,7 +1059,7 @@ var y = e.pageY - btn.offsetTop - btn.offsetParent.offsetTop
content: '';
background: linear-gradient(rgba(255, 255, 255, 0.001), white);
position: absolute;
width: 300px;
width: 240px;
height: 25px;
bottom: 0;
pointer-events: none;
@ -1067,15 +1067,15 @@ var y = e.pageY - btn.offsetTop - btn.offsetParent.offsetTop
.snippet-demo__overflow-scroll-gradient__scroller {
overflow-y: scroll;
background: white;
width: 300px;
height: 250px;
width: 240px;
height: 200px;
padding: 15px 0;
line-height: 1.2;
text-align: center;
}
</style>
<script>
document.querySelector('.snippet-demo__overflow-scroll-gradient__scroller').innerHTML = 'content '.repeat(200)
document.querySelector('.snippet-demo__overflow-scroll-gradient__scroller').innerHTML = 'content '.repeat(100)
</script>
<h4>Explanation</h4>
<ol>
@ -1083,7 +1083,7 @@ var y = e.pageY - btn.offsetTop - btn.offsetParent.offsetTop
<li><code>::after</code> defines a pseudo element.</li>
<li><code>background-image: linear-gradient(...)</code> adds a linear gradient that fades from transparent to white (top to bottom).</li>
<li><code>position: absolute</code> takes the pseudo element out of the flow of the document and positions it in relation to the parent.</li>
<li><code>width: 300px</code> matches the size of the scrolling element (which is a child of the parent that has the pseudo element).</li>
<li><code>width: 240px</code> matches the size of the scrolling element (which is a child of the parent that has the pseudo element).</li>
<li><code>height: 25px</code> is the height of the fading gradient pseudo-element, which should be kept relatively small.</li>
<li><code>bottom: 0</code> positions the pseudo-element at the bottom of the parent.</li>
<li><code>pointer-events: none</code> specifies that the pseudo-element cannot be a target of mouse events, allowing text behind it to still be selectable/interactive.</li>