Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


                <div class='vertical-menu-wrapper'>
  <ul class="vertical-menu ul--reset">
    <li class="vertical-menu-item is-active">
      <a class="link--inverse-menu" data-vertical="1" href="">This is the Day</a>
    <li class="vertical-menu-item">
      <a class="link--inverse-menu" data-vertical="2" href="">Hello World</a>
    <li class="vertical-menu-item">
      <a class="link--inverse-menu" data-vertical="3" href="">Just Don't Forget</a>
    <li class="vertical-menu-item">
      <a class="link--inverse-menu" data-vertical="4" href="">Us vs. Them</a>
    <li class="vertical-menu-item">
      <a class="link--inverse-menu" data-vertical="5" href="">Flavor of the Month</a>
    <li class="vertical-menu-item">
      <a class="link--inverse-menu" data-vertical="6" href="">Things We're Loving</a>
  <i class='active-marker'>


                $menu-item-height: 41px;
$menu-item-spacing: 16px;

body {
  font-size: 100%;
  background: #1d1d31;
  color: #fff;

.ul--reset {
  list-style-type: none;
  margin: 0;
  padding: 0;

.vertical-menu {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  width: 220px;  // Avoid jitter on menu item click

.vertical-menu-wrapper {
  max-width: 230px;
  margin: 50px auto;
  display: flex;
  position: relative;

.active-marker {
  // Initially, this is positioned so that the first menu item is shown as active.
  transition: transform 0.4s;
  width: 5px;
  background-image: linear-gradient(90deg, #ff5e5e, #f54985);
  background-size: 100%;
  height: 30px;
  margin-left: 7px;
  transform: translateY(0px);

.vertical-menu-item {
  font-size: 1.1em;
  color: #fff;
  transition: all 0.4s;
  height: $menu-item-height;  // Define height here to ensure no spacing change on hover effect
  text-align: right;

  &.is-active {
    // Note: it's better to use scale or another property change when possible (things that don't trigger repaints) vs font size changes in a transition.
    font-size: 1.4em;

.link--inverse-menu {
  color: #fff;
  text-decoration: none;

  &:visited {
    color: #fff;

  &:active {
    color: #d3d3d3;



                const getItemOffset = (item) => {
  return item.offsetTop;

const moveMarker = (offset) => {
  const marker = document.querySelector('.active-marker'); = `translateY(${offset}px)`;

const toggleActive = (e) => {
  // Remove any existing active classes
  const links = document.querySelectorAll('.vertical-menu-item');
  links.forEach((link => link.classList.remove('is-active')));
  // Add class to active link
  const activeItem =
  const offset = getItemOffset(activeItem);

// Attach click event listener
const menu = document.querySelector('.vertical-menu');

menu.addEventListener('click', toggleActive);