generator-pho
Version:
Project generator that includes pho-devstack
131 lines (109 loc) • 2.32 kB
text/less
/*
* A collection of useful helper mixins
*
<% if (less) { %> * - .group - clears floats, used as a wrap for column layout
* - .pseudo([@display:block, @content:'']) - sets display and content of an
* element
* - .absolute([@left:0, @top:0 | @square:0]) - positions an element absolutely
* - .min-size([@width:0, @height:0 | @square:0])
* - .max-size([@width:100%, @height:100% | @square:100%])
* - .pointer-events([@value:all])
*/
.group {
*zoom: 1;
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
.pseudo (: block, : '') {
content: ;
display: ;
}
.absolute (: 0, : 0) {
position: absolute;
left: ;
top: ;
}
.absolute (: 0) {
position: absolute;
left: ;
top: ;
}
.min-size(: 0, : 0) {
min-width: ;
min-height: ;
}
.min-size(: 0) {
min-width: ;
min-height: ;
}
.max-size(: 100%, : 100%) {
max-width: ;
max-height: ;
}
.max-size(: 100%) {
max-width: ;
max-height: ;
}
.pointer-events(:all) {
pointer-events: ;
-ms-pointer-events: ;
}
<% } if (sass) { %>
* - group - clears floats, used as a wrap for column layout
* - pseudo([$display:block, $content:'']) - sets display and content of an
* element
* - absolute([$left:0, $top:0 | $square:0]) - positions an element absolutely
* - min-size([$width:0, $height:0 | $square:0])
* - max-size([$width:100%, $height:100% | $square:100%])
* - pointer-events([$value:all])
*/
group {
*zoom: 1;
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
pseudo ($display: block, $content: '') {
content: $content;
display: $display;
}
absolute ($x: 0, $y: 0) {
position: absolute;
left: $x;
top: $y;
}
absolute ($xy: 0) {
position: absolute;
left: $xy;
top: $xy;
}
min-size($w: 0, $h: 0) {
min-width: $w;
min-height: $h;
}
min-size($square: 0) {
min-width: $square;
min-height: $square;
}
max-size($w: 100%, $h: 100%) {
max-width: $w;
max-height: $h;
}
max-size($square: 100%) {
max-width: $square;
max-height: $square;
}
pointer-events($value:all) {
pointer-events: $value;
-ms-pointer-events: $value;
}
<% } %>