Commit bc29631e authored by Nikolay Gromov's avatar Nikolay Gromov

adaptive helpers mixins

parent 6a895b30
...@@ -201,7 +201,6 @@ ...@@ -201,7 +201,6 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Правила для адаптивной таблицы // Правила для адаптивной таблицы
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -274,3 +273,56 @@ ...@@ -274,3 +273,56 @@
} }
} }
} }
//------------------------------------------------------------------------------
// Сокрытие блоков на указанных вьюпортах
//------------------------------------------------------------------------------
// .selector {
// .hidden-up(lg); // Скрыть на LG (включительно) и шире
// .hidden-down(sm); // Скрыть на SM (включительно) и уже
// }
//------------------------------------------------------------------------------
.hidden-up(@screen: xs) {
// & when (@screen = xs) { // XS по умолчанию 0, так что это бессмысленно
// @media (min-width: @screen-xs) { display: none; }
// }
& when (@screen = sm) {
@media (min-width: @screen-sm) { display: none; }
}
& when (@screen = md) {
@media (min-width: @screen-md) { display: none; }
}
& when (@screen = lg) {
@media (min-width: @screen-lg) { display: none; }
}
& when (@screen = xl) {
@media (min-width: @screen-xl) { display: none; }
}
& when (@screen = xxl) {
@media (min-width: @screen-xxl) { display: none; }
}
}
.hidden-down(@screen: xs) {
& when (@screen = xs) {
@media (max-width: (@screen-sm - 1)) { display: none; }
}
& when (@screen = sm) {
@media (max-width: (@screen-md - 1)) { display: none; }
}
& when (@screen = md) {
@media (max-width: (@screen-lg - 1)) { display: none; }
}
& when (@screen = lg) {
@media (max-width: (@screen-xl - 1)) { display: none; }
}
& when (@screen = xl) {
@media (max-width: (@screen-xxl - 1)) { display: none; }
}
& when (@screen = xxl) {
@media (max-width: (@screen-xxl - 1)) { display: none; }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment