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.


                <body class="bg_primary color_secondary">
  <main class="bg_primary color_secondary">
    <dkv class="center">
      <button class="js_switch">
        Switch Mode
    <h1 class="color_secondary">L'interMEDIAire</h1>
    <h2 class="color_secondary">Titre 2</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam ipsam delectus sapiente officia temporibus quam dolorum nam iusto asperiores vitae, quia, ratione hic quod vel unde quae tempore a in.Earum sapiente cupiditate ducimus amet quo provident! Adipisci eaque ducimus incidunt tempora ipsa? Iusto, repellat aliquam reprehenderit fugit! Perspiciatis, reprehenderit quisquam excepturi!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsum velit nam illo molestiae earum, distinctio recusandae omnis eius soluta. Saepe asperiores libero modi est eum rem aliquid dolorum laudantium magnam.</p>
    <a href="#">Plus d'infos</a>
    <img src="" alt="Chat !" />


body[data-theme="dark"] {
  --color_primary: black;
  --color_secondary: rgba(152,38,114,1);
  --grayscale: grayscale(100%);

body[data-theme="light"] {
  --color_primary: rgba(152,38,114,1);
  --color_secondary: black;
  --grayscale: grayscale(0%);

$blanc:       rgba(255,255,255,1);
$gris2:       rgba(255,255,255,.8);
$padding:     20px 10px;

*,*:after,*:before {
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;

body {
  margin: 0px auto;
  padding: $padding;
  max-width: 640px;
  background: var(--color_primary);
  color: var(--color_primary);
  font-size: 1em;

main {
  padding: $padding;

a {
  color: var(--color_secondary);
  text-decoration: none;
  transition: all .3s ease-in-out;

a:active {
  color: $blanc;

h1 {
  font-size: 1.6em;

h2 {
  margin-top: 12px;
  font-weight: normal;

h2 {
  color: var(--color_secondary);
  font-family: 'Inconsolata', monospace;

p {
  color: $gris2;
  line-height: 1.6em;

img {
  margin-top: 20px;
  width: 100%;
  height: auto;
  filter: var(--grayscale);

button {
  margin-bottom: 24px;
  padding: 0px 12px;
  height: 40px;
  background: var(--color_primary);
  color: var(--color_secondary);
  line-height: 40px;
  border: 1px solid #{var(--color_secondary)};
  cursor: pointer;



                const btn = $('.js_switch')
let darkMode = localStorage.getItem("dark-mode")

const enableDarkMode = () => {
  $('body').attr("data-theme", "dark")
  localStorage.setItem("dark-mode", "enabled");

const disableDarkMode = () => {
  $('body').attr("data-theme", "light")
  localStorage.setItem("dark-mode", "disabled");

if (darkMode === "disabled") {
else {

$(btn).on('click', function(e) {
  darkMode = localStorage.getItem("dark-mode")
  if (darkMode === "disabled") {
  } else {