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.

              <ul class="minion-art">
<li class="minion-art--minion"></li>
// Based on Una's post:

// Setting the colors we're syncing up with
$pixel-color-map: (
  'y' : #eef30c,
  'b' : #0057a8,
  'g' : #a1a3a2,
  'w' : #fff,
  'k' : #010101,
  'o' : transparent,

// Size of the pixels
$pixel-size: 20px !default;

// Minion pixel art matrices!
$pixel-art: (
  minion: (
    (o o o y y y y y y o o o)
    (o o y y y g g y y y o o)
    (o y y y g w w g y y y o)
    (o k k g w k k w g k k o)
    (o k k g w k k w g k k o)
    (o y y y g w w g y y y o)
    (o y y y y g g y y y y o)
    (o y y k y y y y k y y o)
    (o y y y k k k k y y y o)
    (o y y y y y y y y y y o)
    (o b y y y y y y y y b o)
    (o y b b b b b b b b y o)
    (o y y b b b b b b y y o)
    (o y y b b b b b b y y o)
    (o y b b b b b b b b y o)
    (k k b b b b b b b b k k)
    (o k b b b b b b b b k o)
    (o o o k k o o k k o o o)
    (o o k k k o o k k k o o)

// Function to read the matrix and pixelize it!
@function pixelize($matrix, $size){
    $l: length($matrix); // length of the entire
    $sh: ''; // shadows list
    $i: $l; // length of the line

    // read through the length of the matrix and decide on the box shadow color and position
    @for $i from 1 through $l{
      $row: nth($matrix,$i); //

      @for $j from 1 through length($row){
          $item: nth($row,$j);

          @if map-has-key($pixel-color-map, $item) {
            $sh:  $sh + ($j*$size) + ' ' + ($i*$size) + ' ' + map-get($pixel-color-map, $item);
          } @else {
            @warn 'there is no color specified in "$pixel-color-map" for: "#{$item}"';

        @if not ($j == length($row) and $i == $l) {
          $sh: $sh + ',';

    @return unquote($sh);

// Mixin to style each item
@mixin style-item($matrix, $size){
  position: relative; // pixels stack next to each other

  // set width & height of icon based on size of pixels
  width:($size * length(nth($matrix,1)));
  height:($size * length($matrix));

    content: '';

    // position everything from the top left corner
    position: absolute;
    top: (-$size);
    left: (-$size);
    width: $size;
    height: $size;
    border-radius: 30%;

    // this is where we make the stitch
    box-shadow: pixelize($matrix,$size);

// Page styling
body {
  background: #fff;

  list-style: none;
  margin: 3em auto;
  max-width: 800px;
  padding: 0;
  text-align: center;
  width: 100%;

  li {
    display: inline-block;
    margin: 2em;

   @each $key, $value in $pixel-art{
      @include style-item($value, $pixel-size);

🕑 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.