Skip to content

Instantly share code, notes, and snippets.

@elvism16
elvism16 / parent-var.scss
Created December 19, 2018 12:36
scss with parent var
.teaser {
$parent: &;
margin-bottom: 20px;
position: relative;
&#{$parent}--no-img {
margin-top: 30opx;
&:before {
@elvism16
elvism16 / bem-at-root.scss
Last active December 19, 2018 12:35
BEM with at-root directive
.block {
display: block;
@at-root #{&}__element {
position: relative;
}
@at-root #{&}--modifier {
display: flex;
}
}
@elvism16
elvism16 / rem-calc.scss
Last active August 1, 2023 21:28
sass-function to convert px to rem or em / extracted from the foundation-framework
// This is the default html and body font-size for the base rem value.
$rem-base: 16px !default;
// STRIP UNIT
// It strips the unit of measure and returns it
@function strip-unit($num) {
@return $num / ($num * 0 + 1);
}
// CONVERT TO REM
@elvism16
elvism16 / flexbox
Created April 12, 2016 07:04
flexbox-mixin
// Flexbox Mixins
//
// 1. Flexbox Containers
// 2. Flexbox Direction
// 3. Flexbox Wrap
// 4. Flexbox Order
// 5. Flexbox Grow
// 6. Flexbox Shrink
// 7. Flexbox Basis
// 8. Flexbox Justify Content