cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              	<div class="content">
		<div class="main-container">
      <input type="radio" id="pink" name="colors" class="switch" checked>
      <input type="radio" id="purpure" name="colors" class="switch">
      <input type="radio" id="red" name="colors" class="switch">
      <input type="radio" id="orange" name="colors" class="switch">
      <input type="radio" id="green" name="colors" class="switch">
      <div class="error">
				<span>Your browser doesn't support a CSS Variables</span>
				<span class="error__hint">Use other browser. For example: Chrome or Firefox</span>
			</div>
			<div class="demo">
				<h1 class="title">Progress with CSS variables</h1>
				<div class="control-panel">
					<div class="control-panel__item">
						<span class="control-panel__hint">Select color:</span>
						<label for="pink" class="select-color select-color_pink">Pink</label>
						<label for="purpure" class="select-color select-color_purpure">Purpure</label>
						<label for="red" class="select-color select-color_red">Red</label>
						<label for="orange" class="select-color select-color_orange">Orange</label>
						<label for="green" class="select-color select-color_green">Green</label>
					</div>
					<div class="control-panel__item">
						<span class="control-panel__hint">Select value:</span>
						<input class="range js-value-progress" type="range" min="0" max="100" step="5" value="55">
					</div>
				</div>
				<div class="cssui-progress js-progress">
					<progress class="cssui-progress__bar js-progress__bar" max="100" value="55"></progress>
					<span class="js-progress__value cssui-progress__value">55%</span>
				</div>
			</div>
		</div>
    <footer class="footer">
        <div class="main-container footer__container">
          <div class="footer__column">
            <span>You liked?</span>
            <a href="https://www.paypal.me/melnik909" class="donate" rel="noopener noreferrer" target="_blank">Buy me a tea?</a>
          </div>
          <a href="http://stas-melnikov.ru" class="melnik909" rel="noopener noreferrer" target="_blank">Developed by Stas Melnikov</a>
        </div>
      </footer>
	</div>
            
          
!
            
              /*!
 * Progress with CSS variables
 * Copyright Stas "melnik909" Melnikov (https://stas-melnikov.ru)
 * Licensed under the MIT license
 */
/* declaration variables  for demo */
:root {
  --displayError: none;
  --displayDemo: block;
  --bgColor: #F8BBD0;
  --color: #C2185B;
}

/* setting a basic font size */
@media screen and (min-width: 981px) {
  html {
    font-size: 62.5%;
  }
}
@media screen and (min-width: 641px) and (max-width: 980px) {
  html {
    font-size: 9px;
  }
}
@media screen and (max-width: 640px) {
  html {
    font-size: 8px;
  }
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Open Sans", "Helvetica Neue", "Segoe UI", sans-serif;
  font-size: 1.6rem;
  margin: 0;
  -webkit-overflow-scrolling: touch;
  background-color: #f0f0f0;
}
   
a {
  color: #C2185B;
}

.title {
  margin: 0 0 8rem;
  font-size: 3rem;
  font-weight: 300;
}

.error {
  font-size: 3rem;
  font-weight: 700;
  display: block;
  display: var(--displayError);
}

.error__hint {
  display: block;
  font-size: 1.8rem;
  margin-top: .5rem;
}

/* styles for layout */
.content {
  min-height: 100vh;
  padding-bottom: 8rem;
  box-sizing: border-box;
  position: relative;
}

.main-container {
  min-width: 100px;
  max-width: 800px;
  padding-top: 6rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding-left: 1rem;
  padding-right: 1rem;
}

.footer {
  text-align: center;
  width: 100%;
  padding-top: 2rem;
  padding-bottom: 2rem;
  position: absolute;
  left: 0;
  bottom: 0;
}

@media screen and (max-width: 640px) {
 	
  .footer {
    font-size: 1.4rem;
  }
}

.footer__container {
  display: flex;
  justify-content: center;
}

.melnik909 {
  margin-left: 2rem;
}

.demo {
  display: none;
  display: var(--displayDemo);
}

/* control-panel */
.control-panel {
  display: flex;
  justify-content: center;
  margin-bottom: 8rem;
}

@media screen and (max-width: 640px) {
  .control-panel {
    flex-direction: column;
    align-items: center;
  }
}
.control-panel__item {
  display: flex;
  align-items: center;
  margin-right: 2%;
}

@media screen and (max-width: 640px) {
  .control-panel__item {
    margin-top: 5rem;
  }

  .control-panel__item:first-child {
    margin-top: 0;
  }
}
.control-panel__hint {
  font-weight: 700;
  margin-right: .5rem;
}

/* select select-color */
.select-color {
  width: 3rem;
  height: 3rem;
  display: inline-block;
  margin-left: .5rem;
  margin-right: .5rem;
  cursor: pointer;
  overflow: hidden;
  border-radius: 50%;
  text-indent: -999px;
}

.select-color_pink {
  background-color: #C2185B;
}

.select-color_purpure {
  background-color: #512DA8;
}

.select-color_red {
  background-color: #D32F2F;
}

.select-color_orange {
  background-color: #F57C00;
}

.select-color_green {
  background-color: #388E3C;
}

#pink:checked ~ .demo {
  --bgColor: #F8BBD0;
  --color: #C2185B;
}

#purpure:checked ~ .demo {
  --bgColor: #D1C4E9;
  --color: #512DA8;
}

#red:checked ~ .demo {
  --bgColor: #FFCDD2;
  --color: #D32F2F;
}

#orange:checked ~ .demo {
  --bgColor: #FFE0B2;
  --color: #F57C00;
}

#green:checked ~ .demo {
  --bgColor: #C8E6C9;
  --color: #388E3C;
}

/* switch */
.switch {
  position: absolute;
  top: 0;
  left: -9999px;
}

/* range */
.range {
  appearance: none;
}

.range:focus {
  outline: none;
}

.range::-webkit-slider-runnable-track {
  height: 3px;
  cursor: pointer;
  background-color: var(--bgColor);
  border: none;
}

.range::-webkit-slider-thumb {
  width: 2rem;
  height: 2rem;
  transform: translateY(-50%);
  background-color: var(--color);
  border-radius: 50%;
  appearance: none;
}

.range::-moz-range-track {
  height: 3px;
  cursor: pointer;
  background-color: var(--bgColor);
  border: none;
}

.range::-moz-range-thumb {
  width: 2rem;
  height: 2rem;
  transform: translateY(-5%);
  background-color: var(--color);
  border-radius: 50%;
  appearance: none;
  border: none;
}

/*
 * progress styles
 */
/* core styles */
:root {
  --cssuiProgressHeight: 2rem;
}

.cssui-progress__bar {
  appearance: none;
  border: none;
  display: block;
  height: var(--cssuiProgressHeight);
  background-color: var(--cssuiProgressBgColor);
  color: var(--cssuiProgressColor);
}
.cssui-progress__bar[value]::-webkit-progress-bar {
  background-color: var(--cssuiProgressBgColor);
}
.cssui-progress__bar[value]::-webkit-progress-value {
  background-color: var(--cssuiProgressColor);
  transition: width .4s ease-out;
}
.cssui-progress__bar[value]::-moz-progress-bar {
  background-color: var(--cssuiProgressColor);
}

/* styles for demo */
.cssui-progress__bar {
  width: 85%;
  margin-right: auto;
  margin-left: auto;
  --cssuiProgressBgColor: var(--bgColor);
  --cssuiProgressColor: var(--color);
  --cssuiProgressHeight: 5px;
}

.cssui-progress__value {
  font-weight: 700;
  font-size: 2rem;
  margin-top: 1rem;
  display: inline-block;
}

            
          
!
            
              // change progress value

(function(){

			var progress = document.querySelector(".js-progress"),
			progressBar = progress.querySelector(".js-progress__bar"),
			progressValue = progress.querySelector(".js-progress__value");

			document.querySelector(".js-value-progress").addEventListener("change", function(){

				progressBar.value = this.value;
				progressValue.textContent = this.value + "%";

			});

		})();


            
          
!
999px
Loading ..................

Console