Skip to content

Instantly share code, notes, and snippets.

@paulhhowells
Last active August 22, 2016 16:55
Show Gist options
  • Save paulhhowells/edee463a7b01d27dc440c1e9870f40f6 to your computer and use it in GitHub Desktop.
Save paulhhowells/edee463a7b01d27dc440c1e9870f40f6 to your computer and use it in GitHub Desktop.
.adjust {
@include: float-fix();
}
.adjust__fix {
float: left;
}
.adjust__fix--10 {
// Rather than include this example class, it’s expected a sibling class would determine width.
width: 10em;
}
.adjust__fix--right,
.adjust__fix.right {
float: right;
}
.adjust__flex {
// Flex.
overflow: hidden;
}
/** Examples:
<div class="adjust">
<div class="adjust__fix">SHRINK TO FIT</div>
<div class="adjust__flex">FLEXIBLE WIDTH</div>
</div>
<div class="adjust">
<div class="adjust__fix adjust__fix--right">SHRINK TO FIT</div>
<div class="adjust__flex">FLEXIBLE WIDTH</div>
</div>
<div class="adjust">
<div class="adjust__fix adjust__fix--10">FIXED WIDTH</div>
<div class="adjust__flex">FLEXIBLE WIDTH</div>
</div>
<div class="adjust">
<div class="adjust__fix adjust__fix--10 adjust__fix--right">FIXED WIDTH</div>
<div class="adjust__flex">FLEXIBLE WIDTH</div>
</div>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment