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


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.


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.

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.


  .description Try pressing any of the buttons below. #[br] Connect a gamepad to make the labels change. #[br] Feel free to play with the example code!
    #button-c.button'') Check out Contro's GitHub repository!


                @import  '';

$color: #37323D;

* {
  margin: 0;
  padding: 0;
  user-select: none;

body {
  display: flex;
  height: 100vh;
  font-family: 'Source Sans Pro', Helvetica, sans-serif;
  color: $color;

.main {
  margin: auto;
  text-align: center;

.logo {
  width: 200px;
  margin-bottom: 20px;

.description {
  max-width: 400px;
  margin-bottom: 25px;
  line-height: 24px;

.buttons {
  display: flex;
  justify-content: center;

.button {
  padding: 6px 15px;
  border-radius: 5px;
  font-size: 26px;
  background: #fff;
  border: 2px solid $color;
  color: $color;
  box-shadow: 0 1px 5px 1px rgba($color, .15);
  transition: .04s ease-in-out;
  &.pressed {
    background: $color;
    color: #fff;
  &+.button {
    margin-left: 15px;

a {
  color: $color;

.link {
  display: inline-block;
  margin-top: 25px;


                const { Gamepad, Keyboard, or } = Contro

const gamepad = new Gamepad()
const keyboard = new Keyboard()

const controls = {
  a: or(gamepad.button('B'), keyboard.key('Esc')),
  b: or(gamepad.button('A'), keyboard.key('Space')),
  c: or(gamepad.button('Start'), keyboard.key('Enter')),

function loop() {
  for (const letter of ['a', 'b', 'c']) {
    const button = document.getElementById('button-' + letter)
    const control = controls[letter]
    button.textContent = control.label
    button.classList.toggle('pressed', control.query())