Skip to content

Instantly share code, notes, and snippets.

@greggman
Created April 28, 2026 22:22
Show Gist options
  • Select an option

  • Save greggman/f3194b60711d94523e828db54bdc9325 to your computer and use it in GitHub Desktop.

Select an option

Save greggman/f3194b60711d94523e828db54bdc9325 to your computer and use it in GitHub Desktop.
Progress Bar
:root {
--progress-height: 24px;
--progress-radius: 24px;
--bar-bg: #e5e7eb;
--progress-color: #3b82f6; /* Modern Blue */
--stripe-color: rgba(255, 255, 255, 0.2);
--text-color: #1f2937;
}
* {
box-sizing: border-box;
}
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.progress-bar {
width: 100%;
height: var(--progress-height);
background-color: var(--bar-bg);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
position: relative;
border-radius: var(--progress-radius);
&>div {
height: 100%;
border-radius: var(--progress-radius);
background-color: var(--progress-color);
transition: width 0.5s ease-out;
background-image: linear-gradient(
45deg,
var(--stripe-color) 25%,
transparent 25%,
transparent 50%,
var(--stripe-color) 50%,
var(--stripe-color) 75%,
transparent 75%,
transparent
);
background-size: 40px 40px;
animation: move-stripes 1s linear infinite;
}
}
@keyframes move-stripes {
from { background-position: 40px 0; }
to { background-position: 0 0; }
}
<div class="progress-bar">
<div style="width:50%"></div>
</div>
<!-- note: the <progress> element is not stylable in 2026 without browser specific hacks -->
/*bug-in-github-api-content-can-not-be-empty*/
{"name":"Progress Bar","settings":{},"filenames":["index.html","index.css","index.js"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment