css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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="bl_mario">
  <div class="bl_mario_itemRed1"></div>
  <div class="bl_mario_itemRed2"></div>
  <div class="bl_mario_itemRed3"></div>
  <div class="bl_mario_itemRed4"></div>
  <div class="bl_mario_itemRed5"></div>
  <div class="bl_mario_itemRed6"></div>
  <div class="bl_mario_itemRed7"></div>
  <div class="bl_mario_itemRed8"></div>
  <div class="bl_mario_itemRed9"></div>
  <div class="bl_mario_itemRed10"></div>
  <div class="bl_mario_itemRed11"></div>
  <div class="bl_mario_itemRed12"></div>
  <div class="bl_mario_itemRed13"></div>
  <div class="bl_mario_itemGre1"></div>
  <div class="bl_mario_itemGre2"></div>
  <div class="bl_mario_itemGre3"></div>
  <div class="bl_mario_itemGre4"></div>
  <div class="bl_mario_itemGre5"></div>
  <div class="bl_mario_itemGre6"></div>
  <div class="bl_mario_itemGre7"></div>
  <div class="bl_mario_itemGre8"></div>
  <div class="bl_mario_itemGre9"></div>
  <div class="bl_mario_itemGre10"></div>
  <div class="bl_mario_itemGre11"></div>
  <div class="bl_mario_itemGre12"></div>
  <div class="bl_mario_itemGre13"></div>
  <div class="bl_mario_itemGre14"></div>
  <div class="bl_mario_itemGre15"></div>
  <div class="bl_mario_itemGre16"></div>
  <div class="bl_mario_itemGre17"></div>
  <div class="bl_mario_itemGre18"></div>
  <div class="bl_mario_itemGre19"></div>
  <div class="bl_mario_itemGre20"></div>
  <div class="bl_mario_itemGre21"></div>
  <div class="bl_mario_itemYel1"></div>
  <div class="bl_mario_itemYel2"></div>
  <div class="bl_mario_itemYel3"></div>
  <div class="bl_mario_itemYel4"></div>
  <div class="bl_mario_itemYel5"></div>
  <div class="bl_mario_itemYel6"></div>
  <div class="bl_mario_itemYel7"></div>
  <div class="bl_mario_itemYel8"></div>
  <div class="bl_mario_itemYel9"></div>
  <div class="bl_mario_itemYel10"></div>
  <div class="bl_mario_itemYel11"></div>
  <div class="bl_mario_itemYel12"></div>
  <div class="bl_mario_itemYel13"></div>
  <div class="bl_mario_itemYel14"></div>
  <div class="bl_mario_itemYel15"></div>
</div>
            
          
!
            
              $pixel: 10px;
$red: #db2900;
$green: #8a7301;
$yellow: #ffa33c;


.bl_mario {
    display: grid;
    grid-template-columns: 1fr repeat(12, $pixel) 1fr;
    grid-template-rows: repeat(16, $pixel);
    grid-template-areas : 
        "... ... ... ... r01 r01 r01 r01 r01 ... ... ... ..." 
        "... ... ... r02 r02 r02 r02 r02 r02 r02 r02 r02 ..." 
        "... ... ... g01 g01 g01 y01 y01 g02 y02 ... ... ..." 
        "... ... g04 y05 g03 y03 y01 y01 g02 y02 y04 y04 ..." 
        "... ... g04 y05 g03 g05 y01 y01 y06 g06 y04 y04 y07" 
        "... ... g07 g07 y08 y08 y01 y01 g08 g08 g08 g08 ..." 
        "... ... ... ... y09 y09 y09 y09 y09 y09 y09 ... ..." 
        "... ... ... g09 g09 r03 g10 g10 g10 ... ... ... ..." 
        "... ... g13 g09 g09 r03 g11 g11 r04 g12 g12 g12 ..." 
        "... g14 g14 g14 g14 r05 r05 r05 r05 g12 g12 g12 g15" 
        "... y10 y10 g16 r06 y11 r07 r07 y12 r08 g17 y13 y13" 
        "... y10 y10 y14 r09 r09 r09 r09 r09 r09 y15 y13 y13" 
        "... y10 y10 r10 r09 r09 r09 r09 r09 r09 r11 y13 y13" 
        "... ... ... r12 r12 r12 ... ... r13 r13 r13 ... ..." 
        "... ... g18 g18 g18 ... ... ... ... g19 g19 g19 ..." 
        "... g20 g18 g18 g18 ... ... ... ... g19 g19 g19 g21";

    @for $i from 1 through 21 {
        &_itemRed#{$i} {
            @if $i < 10 {
                grid-area: r0#{$i};
            } @else {
                grid-area: r#{$i};
            }
            background-color: $red;
        }
        &_itemGre#{$i} {
            @if $i < 10 {
                grid-area: g0#{$i};
            } @else {
                grid-area: g#{$i};
            }
            background-color: $green
        }
        &_itemYel#{$i} {
            @if $i < 10 {
                grid-area: y0#{$i};
            } @else {
                grid-area: y#{$i};
            }
            background-color: $yellow;
        }
    }
}
            
          
!
999px
🕑 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.
Loading ..................

Console