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.




  --background: #232349;
  --text: #cecbf8;
  --pink: #f40099;
  --yellow: #f5e43c;
  --blue: #00f7f7;
  --purple: #363663;
  --gradient: linear-gradient(135deg, var(--yellow), var(--pink), var(--blue));

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

  font: 18px monospace;

  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  color: var(--text);
  text-align: center;

picture {
  max-width: 100%;
  display: block;

a:not([class]) {
  text-decoration-skip-ink: auto;

  background: var(--background);
  font: 18px sans-serif;

  text-align: center;

h1, h2{
  font-family: sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  text-align: center;
  font-size: 48px;
  display: inline-block;
  margin: 10px auto;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -moz-background-clip: text;
  text-fill-color: transparent;
  -webkit-text-fill-color: transparent;
  -moz-text-fill-color: transparent;
  background-size: 100%;
  -webkit-box-decoration-break: clone;

  display: block;
  font-size: 32px;
  color: var(--white);

textarea, input{
  background: var(--purple);
  color: var(--text);
  font-size: 24px;
  padding: 0.6em 1em;
  border: none;
  border-radius: 0.6em;
  outline: none;
  display: flex;
  margin: 0 auto;

  color: var(--blue);
  background: transparent;
  border: 1px var(--blue) solid;
  padding: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  min-width: 10em;
  margin: 4px;

button:hover, button:active, button:focus{
  background: var(--blue);
  color: var(--background);

  max-width: 40em;
  margin: 1em auto;


                import { Nanny,html } from ''

const View = state => html`
<h1>True or False?</h1>
<h2>Score: ${state.score}</h2>
${state.index < state.questions.length ?
html`<p>${state.index + 1}) ${state.questions[state.index].question}</p>
     <button onclick=${state.checkAnswer(true)}>TRUE</button>
     <button onclick=${state.checkAnswer(false)}>FALSE</button>`
html`<h2>Game Over, you scored ${state.score}</h2>`

const checkAnswer = answer => event => Update(state => ({
    score: answer === state.questions[state.index].answer ? state.score + 1 : state.score,
    index: state.index + 1

const State = {
  score: 0,
  index: 0,
  questions: [
    {question: "A Nanny State is a country where nannies are employed by the state", answer: false},
    {question: "Nanny State is also the name of a beer", answer: true},
    {question: "Mila Kunis and Ashton Kutcher employ 16 nannies to look after their children", answer: false},
    {question: "The Nanny McPhee films are based on the Nurse Matilda books", answer: true},
    {question: "Nanny State uses the µhtml library for rendering", answer: true},

const Update = Nanny(State)