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
@grey: #a1a1a1;
.curve(@color: white) {
@ecolor: escape(@color);
background: url("... fill='@{ecolor}' ...");
}
t1 {.curve()} // OK
t2 {.curve(blue)} // OK
t3 {.curve(@grey)} // OK
// data:
.profile_image() {
.thumbnail {width: 200; height: 100}
.large {width: 800; height: 600}
}
// usage:
.profile_image() {
thumbnail: 200 100;
large: 800 600;
}
.profile_image() {
.thumbnail {width: 200; height: 100}
.large {width: 800; height: 600}
}
// or alternatively:
@profile_image: {
@thumbnail: {width: 200; height: 100}
@large: {width: 800; height: 600}
// Mixin
.color(@color) {
&-@{color} {
color: @color;
}
}
// Usage
.text {
.color(red);
// data:
@on-primary: #ffffff;
@icon-variants: active, inactive, disabled;
@icon-opacity-on-primary: 70, 50, 38;
// test:
div {
r: .get-icon-color(inactive)[];
.font(@value) {font-weight: @value}
// usage:
h1 {
.font(700);
}
.get-property-box(@mask) {
.- {
each(@mask, {r+_: @value});
} .-;
return: $r;
}
#usage {
@mask: 5, 6, 42;
border-radius: .get-property-box(@mask)[];
.pipe(less({modifyVars: {
'@color1': '#535859',
'@color2': '#ff0000',
'@color3': '#ccffcc'
}}))