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="toggle-outer-wrapper">
  <h2>Important Heading</h2>
  <p>Don't you hate it when websites have hard to read font titles?</p>

  <div class="toggle-wrapper">

    <label class="toggle-label" for="readable-text-toggle">Readable text
    <div class="switch">
      <input type="checkbox" checked="" class="readable-text-toggle" id="readable-text-toggle">
      <span class="slider round"></span>


                /* Generic styling */

body {
background: #43C6AC;  /* fallback for old browsers */
background: -webkit-linear-gradient(to left, #F8FFAE, #43C6AC);  /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to left, #F8FFAE, #43C6AC); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

.toggle-outer-wrapper {
  text-align: center;
  background: rgba(0,0,0,.5);
  backdrop-filter: hue-rotate(30deg);
  max-width: 700px;
  border-radius: 3rem;
  margin: 0 auto;
  padding: 2em;
  display: flex;
  flex-direction: column;
  align-self: center;
  justify-self: center;

button {
  background: rgba(0,0,0,.7);
  color: #ffffff;
  border: 2px solid transparent;
  padding: 8px 30px;
  border-radius: 50px;
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;

button:focus {
  background: transparent;
  color: #000;
  border: 2px solid #000;
  opacity: .8;

.toggle-outer-wrapper p {
  font-size: 1.5rem;
  color: #ffffff;
  font-family: 'Ubuntu', sans-serif;
  max-width: 400px; 
  margin: 0 auto 30px;
  line-height: 1.5;

/* Relavent */

h2 {
  font-family: 'Cookie', cursive;
  color: #ffffff;
  font-size: 4rem;
  line-height: 1.3;
  margin: 0;

h2.readable-text {
  font-family: 'Ubuntu', sans-serif;
  font-size: 3rem;

label {
  font-family: 'Ubuntu', sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  background: #f6feae;
  color: #223A3A;
  width: fit-content;
  border-radius: 50px;
  padding: 10px 10px 10px 20px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  box-shadow: 0 0 15px rgba(0,0,0,.6);
  border: 2px solid transparent;
  transition: all 0.25s ease-in-out;

label:focus {
  border-color: #223A3A;
  box-shadow: none;
  cursor: pointer;

/* The following taken from W3 and modified */

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin-left: 10px;
/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #3D6969;
  -webkit-transition: .4s;
  transition: .4s;

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: #ffffff;
  -webkit-transition: .4s;
  transition: .4s;

input:checked + .slider {
  background-color: #223A3A;

input:focus + .slider {
  box-shadow: 0 0 1px rgba(0,0,0,.5);

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);

/* Rounded sliders */
.slider.round {
  border-radius: 34px;

.slider.round:before {
  border-radius: 50%;



    if($(this).is(":checked")) {
    } else {