It's a tiny collection of the most used mixins and functions in my projects.
Install using Bower:
$ bower install --save bennis-sass-toolbox
In order to work the project should use the most recent Sass version. So Ruby Sass 3.4 or Libsass 3.2 are good to go.
If using Gulp or Grunt remember to use the most recent Sass plugins!
structure helpers
-
abs-position()
--$top
,$right
,$bottom
,$left
Position element to absolute
-
element()
ore()
-- element nameBuild a element class from parent elements name. Even works when parent is
:hover
-
modifier()
orm()
-- modifier nameBuild a modifier class from parent elements name
-
centerer()
--$h
,$v
,$is3d
Center element horizontal and/or vertical by using
position: absolute
andtransform: translate
. If element is going to be altered by any action promote it totransform: translate3d
.
-
my-size()
--$size
(list)Set
height
andwidth
values and convertpx
torem
if$useRem: true
(default) is set.
general
-
color-fit()
--$makeMeNew
Calculate matching contrasting color values. Predefine custom color matches in
$colorMatches
map.eg:
$colorMatches: ( #fff: #000 );
NOTE: DON'T use quotes (",')! The value won't be recognised as
$color
-
rem()
-- Number or px valueCalculate
rem
value based on$baseFontSize