Skip to content

Instantly share code, notes, and snippets.

View seven-phases-max's full-sized avatar

Max Mikhailov seven-phases-max

View GitHub Profile
.border-top-radius(@radius) {
.border-radius-value(@radius);
border-top-right-radius: @value;
border-top-left-radius: @value;
}
.border-right-radius(@radius) {
.border-radius-value(@radius);
border-bottom-right-radius: @value;
border-top-right-radius: @value;
.border-top-radius(@radius) {.border-radius-impl(top-right, top-left)}
.border-right-radius(@radius) {.border-radius-impl(bottom-right, top-right)}
.border-bottom-radius(@radius) {.border-radius-impl(bottom-right, bottom-left)}
.border-left-radius(@radius) {.border-radius-impl(bottom-left, top-left)}
.border-radius-impl(@a, @b) {
border-@{a}-radius: @value;
border-@{b}-radius: @value;
.-() {@value: 0} .-();
// ...............
@grid-columns: 5;
@grid-gutter-width: 33px;
// ...............
.col-xs-1,
.col-sm-1,
.col-md-1,
@import "for"; // see https://github.com/seven-phases-max/less.curious/blob/master/src/for.less
.map(@property, @class-value-list...) {
.for(@class-value-list); .-each(@value) {
@class: extract(@value, 1);
.@{class} {@{property}: extract(@value, 2)}
}
}
.box-shadow(@values...) {
// http://caniuse.com/#search=box-shadow
.some-meaninful-name(box-shadow,
@values, -webkit- -moz- ~'');
}
.transform(@values) {
// http://caniuse.com/#search=transform
.some-meaninful-name(transform,
@values, -webkit- -moz- -o- ~'');
@import "for";
// ............................................................
.find(@array, @value, @fallback: -1) {
.for(@list); .-each(...) {}
.-each(~'@{value}') {@-: @i}
.-() {@-: @fallback} .-;
}
usage {
background-image: url('../img/web.gif') ; /** sprite-ref: mysprite; */ ;
}
#usage {
.set(result-1, 1 lt 2, "true", "false");
.set(result-2, 3 eq 3, "true-only");
.set(result-3, 4 ne 4, "hidden");
.set(result-4, iscolor(blue), "true", "false");
.set(result-5, iscolor(55), "true", "false");
.set(result-6, isnumber(red), "hidden");
.set(result-7, isnumber(77), "true-only");
//
// Theme Styles
// --------------------------------------------------
// Theme variables
@import "variables.less";
// Bootstrap components
.danger_ .help-block,
.danger_ .control-label,
.danger_ .radio,
.danger_ .checkbox,
.danger_ .radio-inline,
.danger_ .checkbox-inline {
color: #d9534f;
}
.danger_ .form-control,
input.ng-invalid.form-control {