Sha256: 74fbe50335bd165ca16ed56fe591d68be4e4e29bcffac02f1d5f30fdbd087fe4
Contents?: true
Size: 1.54 KB
Versions: 5
Compression:
Stored size: 1.54 KB
Contents
// Black transparent background @function black($opacity){ @return rgba(0, 0, 0, $opacity); } // White transparent background @function white($opacity){ @return rgba(255, 255, 255, $opacity); } // Take a list of classes and generate a selector list @function join-classes($classes, $inherit: true) { $selectors: (); @each $class in $classes { @if str-index($class, ".") != 0 { $class: "." + $class; } @if $inherit { $selectors: $selectors, unquote("&" + $class); } @else { $selectors: $selectors, unquote($class); } } @return $selectors; } // Remove the first selector character (#, ., etc) from the class name or ID @function remove-selector-char($selector) { @return str-slice($selector, 2, str-length($selector)); } // Generate a class name and apply an optional prefix @function class-name($class, $prefix: $vendor-prefix, $selector: ".") { $name: $class; @if str_slice($class, 1, 1) == $selector { $name: remove-selector-char($name); } @if $prefix != "" { $name: $prefix + $name; } @return $selector + $name; } // Format a class name into the BEM format @function bem($block: "", $element: "", $modifier: "", $element-separator: $bem-element-separator, $modifier-separator: $bem-modifier-separator) { $name: $block; @if $element != "" { $name: $name + $element-separator + $element; } @if $modifier != "" { $name: $name + $modifier-separator + $modifier; } @return $name; }
Version data entries
5 entries across 5 versions & 1 rubygems