cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <svg style="position: absolute; width: 0; height: 0;" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <defs>
        <symbol id="icon-clubs" viewBox="0 0 1024 1024">
            <title>clubs</title>
            <path class="path1" d="M786.832 392.772c-59.032 0-112.086 24.596-149.852 64.694-15.996 16.984-43.762 37.112-73.8 54.81 14.11-53.868 58.676-121.7 89.628-151.456 39.64-38.17 63.984-91.83 63.984-151.5 0.006-114.894-91.476-208.096-204.788-209.32-113.32 1.222-204.796 94.426-204.796 209.318 0 59.672 24.344 113.33 63.986 151.5 30.954 29.756 75.52 97.588 89.628 151.456-30.042-17.7-57.806-37.826-73.8-54.81-37.768-40.098-90.82-64.694-149.85-64.694-114.386 0-207.080 93.664-207.080 209.328 0 115.638 92.692 209.338 207.080 209.338 59.042 0 112.082-25.356 149.85-65.452 16.804-17.872 46.444-40.138 78.292-58.632-3.002 147.692-73.532 256.168-145.318 298.906v37.742h384.014v-37.74c-71.792-42.736-142.32-151.216-145.32-298.906 31.852 18.494 61.488 40.768 78.292 58.632 37.766 40.094 90.808 65.452 149.852 65.452 114.386 0 207.078-93.7 207.078-209.338-0.002-115.664-92.692-209.328-207.080-209.328z"></path>
        </symbol>
    </defs>
</svg>

<div class="card card-front">
    <div class="row">
        <div class="number cell col-1">7
            <svg class="icon">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>
        <div class="cell col-2">
            <svg class="icon">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>
        <div class="cell col-2 offset-2">
            <svg class="icon">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>

        <div class="cell col-8">
            <svg class="icon">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>
        <div class="cell col-2 offset-1">
            <svg class="icon rotate">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>
        <div class="cell col-2 offset-2">
            <svg class="icon rotate">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>
        <div class="cell col-2 offset-1">
            <svg class="icon rotate">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>
        <div class="cell col-2 offset-2">
            <svg class="icon rotate">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>
        <div class="rotate number cell col-1">7
            <svg class="icon">
                <use xlink:href="#icon-clubs"></use>
            </svg>
        </div>
    </div>
</div>

            
          
!
            
              //variables to setup basic size and shape of the card and pips
$card-width: 40vw;
$card-height: $card-width*1.4;
$font-size-number: $card-width * 0.1;
$icon-size: $card-width / 5;
$num-columns : 8;
$one-column : 100% / $num_columns;
$loop-start: 1;
$loop-end: $num-columns +1;

$one-column: 12.5%;
   @mixin col($span-num) {
    flex: 0 0 $one-column * $span-num;
}

@mixin offset($offset-num) {
    margin-left: $one-column * $offset-num;
}

@mixin col($span-num) {
    flex: 0 0 12.5% * $span-num;
}

@mixin offset($offset-num) {
    margin-left: 12.5% * $offset-num;
}

//make column classes 
@for $index from $loop-start to $loop-end {
    .col-#{$index} {
        @include col($index);
    }
}

//make offset classes
@for $index from $loop-start to $loop-end {
    .offset-#{$index} {
        @include offset($index);
    }
}

*,
*:before,
*:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.card {
    border: 1px solid grey;
    height: $card-height;
    width: $card-width;
    border-radius: 10px;
    margin: 20px;
    box-shadow: 2px 2px 4px grey;
}

.card-front {
    padding: .5em;
}

.icon {
    width: $icon-size;
    height: $icon-size;
}

.number {
    text-align: center;
    font-size: $font-size-number;
    & > .icon {
        width: $icon-size * .5;
        height: $icon-size *.5;
    }
}

.rotate {
    transform: rotate(180deg);
}

.row {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    align-content: space-between;
    height: 100%;
}

.cell {
    flex: 1;
    text-align: center;
}

.col-1 {
    @include col(1);
}

.col-2 {
    @include col(2);
}

.col-8 {
    @include col(8);
}

.offset-1 {
    @include offset(1);
}

.offset-2 {
    @include offset(2);
}
            
          
!
999px
Loading ..................

Console