Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <article>
  <h1>Pure CSS reading position indicator</h1>
  <p>Plenty of bugs in both Chrome and Safari, but when those are worked out this would be a simple solution to adding a trail to what you have scrolled past to your scrollbar marking progress along an article natively without JS. What are the bugs? As of February 28, 2016 Chrome removes 50% of the tail when scrolling past 50% and Safari doesn’t hide scrollbar styling overflow from the box shadow.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non earum quisquam dolorum distinctio voluptates quaerat dignissimos suscipit expedita ad accusamus, iusto delectus a, quas at ex veritatis nesciunt? Aspernatur, eius!</p>
  <p>Veritatis pariatur eligendi repellendus dolor sed magnam nulla laboriosam necessitatibus beatae dolorem, minus explicabo laudantium ut saepe, vero rem nostrum possimus ex qui, aspernatur doloremque? Sapiente corporis, assumenda iure exercitationem.</p>
  <p>A tempora cupiditate totam sint omnis iure ea. Earum nam libero impedit! Error est officiis minus cupiditate amet, repellendus, cumque incidunt velit. Hic magnam veritatis reiciendis, iste nostrum numquam pariatur!</p>
  <p>Quisquam magnam vel cum quidem enim illum aperiam ducimus fugit, consequatur harum maiores at, neque dolores temporibus odit beatae minima nisi nesciunt mollitia amet animi magni laudantium alias! Ipsum, ipsa!</p>
  <p>Repudiandae praesentium, fugit at expedita cupiditate corrupti illum molestias, magnam similique soluta id molestiae temporibus eos veritatis, numquam quas modi. Velit veritatis, at voluptatum dolore cupiditate? Blanditiis excepturi delectus veniam.</p>
  <p>Commodi repellendus blanditiis reprehenderit nulla, quisquam, maiores voluptate ex laboriosam odit similique praesentium reiciendis, asperiores velit id voluptatum fugit dolore esse facere sequi nemo nobis doloribus itaque corrupti? Vero, excepturi?</p>
  <p>Voluptatem corporis eveniet laborum consectetur, voluptatum repellat saepe fugit, aspernatur eligendi, veritatis ea temporibus ipsa, expedita rem fugiat perspiciatis accusantium consequuntur necessitatibus vitae rerum! Qui rem dolores accusamus consequatur odio.</p>
  <p>Quibusdam dolor, vitae at perspiciatis commodi provident deleniti excepturi nobis et ipsam eligendi aperiam eum nam a vel culpa, quidem velit molestias recusandae perferendis praesentium distinctio! Incidunt alias, ad itaque.</p>
  <p>Voluptatem, magni eaque laudantium facilis reprehenderit non quibusdam natus temporibus impedit suscipit, perferendis labore inventore commodi, qui est, quas harum asperiores! Labore aspernatur, tempora illo nulla rem. Obcaecati, quaerat laboriosam?</p>
  <p>Minima nesciunt tenetur est iure architecto, exercitationem fugit mollitia! Tempore ad molestiae, eos voluptatum deserunt, architecto, magnam deleniti in fuga libero cum ut? Nulla neque, adipisci odio doloremque reiciendis vero!</p>
  <p>Esse beatae sit doloribus. Eveniet libero tenetur quae officia, placeat ab, voluptatibus amet quos dicta, beatae, odit. Et dolores sit explicabo, ipsum ut ipsa consequuntur, similique nam rerum culpa fuga?</p>
  <p>Ipsa nulla blanditiis mollitia dolor repellat quas incidunt omnis quae possimus, aliquid, ullam at pariatur alias nostrum voluptate aperiam ut eligendi, obcaecati architecto, dignissimos veritatis saepe tenetur! Quae asperiores, molestias!</p>
  <p>Eligendi alias praesentium labore voluptas neque reprehenderit maxime odit repellendus beatae veritatis ipsa molestias, et iusto minus tempore est, provident repudiandae fuga voluptatibus in nihil sequi quisquam odio. Mollitia, id.</p>
  <p>Cumque error debitis repudiandae, natus fugit ipsam quia voluptatem ut dolorem maiores placeat totam dolor non in ducimus eius eum, ab exercitationem. Eligendi aliquid est eaque ducimus, quibusdam aut ex!</p>
  <p>Qui assumenda accusantium cumque illum recusandae modi dolores, velit adipisci, unde quam doloremque voluptates sunt hic placeat nemo delectus facere ex natus, ipsa, tempore a nihil molestiae. Modi, dolores labore!</p>
  <p>Iusto reiciendis amet, similique eaque harum qui, vero, quos facere natus dolorem at commodi eveniet numquam ab labore, voluptas alias mollitia odio exercitationem debitis. Aperiam porro ratione odit ipsa rerum.</p>
</article>
              
            
!

CSS

              
                body::-webkit-scrollbar {
  width: 6px;
}
 
body::-webkit-scrollbar-track {
  overflow: hidden;
  background-color: #ddd;
}
body::-webkit-scrollbar-thumb {
  background-color: #ff4f1f;
  box-shadow:
    0 -100vh 0 100vh #ff4f1f;
}

article {
  max-width: 40em;
  margin: auto;
  padding: 10vw 5% 50vh;
  font-size: 18px;
  color: #333;
}
h1 {
  font-style: italic;
}
              
            
!

JS

              
                
              
            
!
999px

Console