Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="theme-select">
  <form onchange="changeTheme()">
    <input type="checkbox" name="theme" id="theme">
    <label for="theme">Dark Theme Active</label>
<div class="card-container">
  <h2 class="card-title">Example of light and dark theme with css</h2>
  <p class="card-description">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam blandit orci mollis lorem venenatis, quis malesuada lacus vehicula. Mauris at nulla quis tellus gravida pulvinar. Morbi sem nulla, lacinia vel mauris vel, dictum pellentesque purus.
Duis luctus tortor ut hendrerit suscipit. Aliquam sodales libero sit amet velit ornare fermentum. Donec aliquam elit vel libero sagittis fermentum. Donec lobortis sem lacus, non sodales dolor finibus nec. Mauris facilisis id mi lacinia interdum. In nec eros tellus.
<div class="author">
  <a href="" target="_blank" title=""> - Mehmet Sert</a>
              @import url(',400,500&display=swap&subset=latin-ext');

:root {
  height: 100%;
  --bg-color: #f9f9f9;
  --card-bg-color: #efeeee;
  --color-primary: #4a4a4a;
  --color-secondary: #505050;
  &[data-theme="dark"] {
    --bg-color: #383838;
    --card-bg-color: #2d2d2d;
    --color-primary: #f5ecec;
    --color-secondary: #bfbfbf;
body {
  padding: 0;
  margin: 0;
  background-color: var(--bg-color);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;

.theme-select {
  margin: 0 0 30px 0;
  width: 80%;
  label {
    color: var(--color-primary);

.card-container {
  width: 80%;
  background-color: var(--card-bg-color);
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0px 10px 30px 0px rgba(0, 0, 0, 0.1);
  .card-title {
    font-weight: 500;
    color: var(--color-primary);
  .card-description {
    color: var(--color-secondary);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 400;
.author {
  margin-top: 40px;
  a {
    color: var(--color-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 100;
              function changeTheme() {
  let themeVal = document.querySelector('input[name="theme"]').checked ? 'dark' : 'light';
  document.documentElement.setAttribute('data-theme', themeVal);
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.