Pen Settings

HTML

CSS

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

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

              
                Pure CSS

<div class="spinner anim-rotate">
  <div class="spinner-inner"></div>
</div>

<br><br>

Original - 16px scaled to 92%

<div style="height:16px; width:16px;" class="mx-auto">
  <svg fill="none" width="92%" height="92%" viewBox="0 0 16 16" class="anim-rotate" xmlns="http://www.w3.org/2000/svg" title="in_progress_icon" aria-hidden="true">
    <path opacity=".5" d="M8 15A7 7 0 108 1a7 7 0 000 14v0z" stroke="#dbab0a" stroke-width="2"></path>
    <path d="M15 8a7 7 0 01-7 7" stroke="#dbab0a" stroke-width="2"></path>
    <path d="M8 12a4 4 0 100-8 4 4 0 000 8z" fill="#dbab0a"></path>
  </svg>
</div>

<br><br>

16px not scaled

<div style="height:16px; width:16px;" class="mx-auto">
  <svg fill="none" viewBox="0 0 16 16" class="anim-rotate" xmlns="http://www.w3.org/2000/svg" title="in_progress_icon" aria-hidden="true">
    <path opacity=".5" d="M8 15A7 7 0 108 1a7 7 0 000 14v0z" stroke="#dbab0a" stroke-width="2"></path>
    <path d="M15 8a7 7 0 01-7 7" stroke="#dbab0a" stroke-width="2"></path>
    <path d="M8 12a4 4 0 100-8 4 4 0 000 8z" fill="#dbab0a"></path>
  </svg>
</div>

<br><br>

Redrawn 14px

<div style="height:16px; width:16px;" class="mx-auto">
  <svg fill="none" width="16" height="16" class="anim-rotate" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" title="in_progress_icon" aria-hidden="true">
    <path opacity="0.5" d="M8 14C9.5913 14 11.1174 13.3679 12.2426 12.2426C13.3679 11.1174 14 9.5913 14 8C14 6.4087 13.3679 4.88258 12.2426 3.75736C11.1174 2.63214 9.5913 2 8 2C6.4087 2 4.88258 2.63214 3.75736 3.75736C2.63214 4.88258 2 6.4087 2 8C2 9.5913 2.63214 11.1174 3.75736 12.2426C4.88258 13.3679 6.4087 14 8 14Z" stroke="#dbab0a" stroke-width="2"/>
    <path d="M8 11C8.79565 11 9.5587 10.6839 10.1213 10.1213C10.6839 9.55871 11 8.79565 11 8C11 7.20435 10.6839 6.44129 10.1213 5.87868C9.5587 5.31607 8.79565 5 8 5C7.20435 5 6.44129 5.31607 5.87868 5.87868C5.31607 6.44129 5 7.20435 5 8C5 8.79565 5.31607 9.55871 5.87868 10.1213C6.44129 10.6839 7.20435 11 8 11Z" fill="#dbab0a"/>
    <path fill-rule="evenodd" clip-rule="evenodd" d="M8 15C9.8565 15 11.637 14.2625 12.9497 12.9497C14.2625 11.637 15 9.85652 15 8H13C13 9.32608 12.4732 10.5979 11.5355 11.5355C10.5979 12.4732 9.3261 13 8 13V15Z" fill="#dbab0a"/>
  </svg>
</div>

<br><br>

Optimised 14px

<div style="height:16px; width:16px;" class="mx-auto">
  <svg fill="none" width="16" height="16" class="anim-rotate" xmlns="http://www.w3.org/2000/svg">
    <path opacity=".5" d="M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12Z" stroke="#DBAB0A" stroke-width="2"/>
    <path d="M8 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" fill="#DBAB0A"/>
    <path fill-rule="evenodd" clip-rule="evenodd" d="M8 15a7 7 0 0 0 7-7h-2a5 5 0 0 1-5 5v2Z" fill="#DBAB0A"/>
  </svg>
</div>

<br><br>

Just a <&zwnj;circle&zwnj;>

<div style="height:16px; width:16px;" class="mx-auto">
  <svg class="anim-rotate" width="16px" height="16px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
    <circle cx="50" cy="50" r="50" fill="#DBAB0A"/>
  </svg>
</div>
  
<br><br>

Just a <&zwnj;circle&zwnj;> but its parent rotates instead (doesn’t help)

<div class="anim-rotate" style="height:16px; width:16px;" class="mx-auto">
  <svg width="16px" height="16px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
    <circle cx="50" cy="50" r="50" fill="#DBAB0A"/>
  </svg>
</div>

<br><br>
  
Redrawn 14px but two SVGs and the complete circles are static

<!-- Black canvas -->
<div style="height:16px; width:16px; position: relative;" class="mx-auto">
  <!-- SVG for full circles -->
  <svg fill="none" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" title="in_progress_icon" aria-hidden="true" style="position: absolute;">
    <!-- Middle circle -->
    <path d="M8 11C8.79565 11 9.5587 10.6839 10.1213 10.1213C10.6839 9.55871 11 8.79565 11 8C11 7.20435 10.6839 6.44129 10.1213 5.87868C9.5587 5.31607 8.79565 5 8 5C7.20435 5 6.44129 5.31607 5.87868 5.87868C5.31607 6.44129 5 7.20435 5 8C5 8.79565 5.31607 9.55871 5.87868 10.1213C6.44129 10.6839 7.20435 11 8 11Z" fill="#dbab0a"/>
    <!-- Outer circle -->
    <path opacity="0.5" d="M8 14C9.5913 14 11.1174 13.3679 12.2426 12.2426C13.3679 11.1174 14 9.5913 14 8C14 6.4087 13.3679 4.88258 12.2426 3.75736C11.1174 2.63214 9.5913 2 8 2C6.4087 2 4.88258 2.63214 3.75736 3.75736C2.63214 4.88258 2 6.4087 2 8C2 9.5913 2.63214 11.1174 3.75736 12.2426C4.88258 13.3679 6.4087 14 8 14Z" stroke="#dbab0a" stroke-width="2"/>
  </svg>
  <!-- SVG for semicircle -->
  <svg fill="none" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" style="position: absolute;" class="anim-rotate">
    <path fill-rule="evenodd" clip-rule="evenodd" d="M8 15C9.8565 15 11.637 14.2625 12.9497 12.9497C14.2625 11.637 15 9.85652 15 8H13C13 9.32608 12.4732 10.5979 11.5355 11.5355C10.5979 12.4732 9.3261 13 8 13V15Z" fill="#dbab0a"/>
  </svg>
</div>

              
            
!

CSS

              
                // Primer CSS animation utility class
.anim-rotate {
  animation: rotate-keyframes 1s linear infinite;
}

@keyframes rotate-keyframes {
  100% {
    transform: rotate(360deg);
  }
}

// Demo style
body {
  margin: 5%;
}

// Demo style; hooks into existing centering class from prod
.mx-auto {
  background-color: black;
}



// Styles for pure CSS icon

// Container
.spinner {
  --spinner-container-size: 1em;
  --spinner-icon-size: calc(var(--spinner-container-size) - 0.125em);
  --spinner-icon-inset: calc((var(--spinner-container-size) - var(--spinner-icon-size)) / 2);
  --spinner-center-size: 0.375em;
  --spinner-center-inset: 0.125em;
  --spinner-border-width: 0.125em;
  --spinner-color: #DBAB0A;
  --spinner-opacity: 0.5;
  
  font-size: 16px;
  height: var(--spinner-container-size);
  width: var(--spinner-container-size);
  position: relative;
}

// Border fragment
.spinner::after {
  border-color: transparent;
  border-radius: 50%;
  border: var(--spinner-border-width) solid transparent;
  // Give only 1/4 of the border a color to draw the fragment
  border-top-color: var(--spinner-color);
  box-sizing: border-box;
  content: "";
  height: var(--spinner-icon-size);
  inset: var(--spinner-icon-inset);
  position: absolute;
  width: var(--spinner-icon-size);
}

// Full border
.spinner-inner {
  border-radius: 50%;
  border: var(--spinner-border-width) solid var(--spinner-color);
  box-sizing: border-box;
  height: var(--spinner-icon-size);
  inset: var(--spinner-icon-inset);
  opacity: var(--spinner-opacity);
  position: absolute;
  width: var(--spinner-icon-size);
}

// Solid inner circle
.spinner-inner::after {
  background-color: var(--spinner-color);
  border-radius: 50%;
  content: "";
  height: var(--spinner-center-size);
  inset: var(--spinner-center-inset);
  position: absolute;
  width: var(--spinner-center-size);
}

              
            
!

JS

              
                
              
            
!
999px

Console