From 233a149095f59675e4236a0c4a2a3e4f9fd4df4c Mon Sep 17 00:00:00 2001 From: atomiks Date: Wed, 28 Feb 2018 16:46:04 +1000 Subject: [PATCH] Update overflow-scroll-gradient.md --- snippets/overflow-scroll-gradient.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/snippets/overflow-scroll-gradient.md b/snippets/overflow-scroll-gradient.md index c0010ddb6..0c4c3e644 100644 --- a/snippets/overflow-scroll-gradient.md +++ b/snippets/overflow-scroll-gradient.md @@ -78,15 +78,16 @@ document.querySelector('.snippet-demo__overflow-scroll-gradient__scroller').inne #### Explanation -1. `position: relative` on the parent establishes a Cartesian positioning context for psuedo elements. +1. `position: relative` on the parent establishes a Cartesian positioning context for psuedo-elements. 2. `::after` defines a pseudo element. 3. `background-image: linear-gradient(...)` adds a linear gradient that fades from transparent to white (top to bottom). 4. `position: absolute` takes the pseudo element out of the flow of the document and positions it in relation to the parent. 5. `width: 300px` matches the size of the scrolling element (which is a child of the parent that has the pseudo element). -6. `height: 25px` is the height of the fading gradient psuedo element, which should be kept relatively small. -7. `bottom: 0` positions the pseudo element at the bottom of the parent. +6. `height: 25px` is the height of the fading gradient psuedo-element, which should be kept relatively small. +7. `bottom: 0` positions the pseudo-element at the bottom of the parent. +8. `pointer-events: none` specifies that the psuedo-element cannot be a target of mouse events, allowing text behind it to still be selectable/interactive. #### Browser support