Skip to content

Instantly share code, notes, and snippets.

@timhettler
Last active November 3, 2015 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timhettler/6802d138df7a84eb6280 to your computer and use it in GitHub Desktop.
Save timhettler/6802d138df7a84eb6280 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="container">
<div class="fpo"></div>
<div class="fpo"></div>
<div class="fpo"></div>
</div>
// ----
// libsass (v3.2.5)
// ----
@mixin fpo($size: 100%, $color--bg: slategray, $color--text: #fff, $text: 'FPO') {
background-color: $color--bg;
position: relative;
&:before {
content: '';
display: block;
padding-bottom: $size;
}
&:after {
content: $text;
color: $color--text;
font: 20px/1 Helvetica;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.fpo {
@include fpo(66%, tomato);
width: 20%;
}
.container {
display: flex;
justify-content: space-around;
width: 100%;
}
.fpo {
background-color: tomato;
position: relative;
width: 20%;
}
.fpo:before {
content: '';
display: block;
padding-bottom: 66%;
}
.fpo:after {
content: "FPO";
color: #fff;
font: 20px/1 Helvetica;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.container {
display: flex;
justify-content: space-around;
width: 100%;
}
<div class="container">
<div class="fpo"></div>
<div class="fpo"></div>
<div class="fpo"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment