|
348 | 348 | @include rtl($prop, $ltr-dense, $rtl-dense);
|
349 | 349 | }
|
350 | 350 | }
|
| 351 | + |
| 352 | +// Only use when in row layout |
| 353 | +@mixin when-layout-row($element) { |
| 354 | + @media (max-width: $layout-breakpoint-xs - 1) { |
| 355 | + .layout-row:not(.layout-xs-column), |
| 356 | + .layout-xs-row { |
| 357 | + & > #{$element} { @content; } |
| 358 | + } |
| 359 | + } |
| 360 | + @media (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) { |
| 361 | + .layout-row:not(.layout-gt-xs-column), |
| 362 | + .layout-gt-xs-row, |
| 363 | + .layout-sm-row { |
| 364 | + &:not(.layout-sm-column) > #{$element} { @content; } |
| 365 | + } |
| 366 | + } |
| 367 | + @media (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) { |
| 368 | + .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column), |
| 369 | + .layout-gt-xs-row:not(.layout-gt-sm-column), |
| 370 | + .layout-gt-sm-row, |
| 371 | + .layout-md-row { |
| 372 | + &:not(.layout-md-column) > #{$element} { @content; } |
| 373 | + } |
| 374 | + } |
| 375 | + @media (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) { |
| 376 | + .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column), |
| 377 | + .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column), |
| 378 | + .layout-gt-sm-row:not(.layout-gt-md-column), |
| 379 | + .layout-gt-md-row, |
| 380 | + .layout-lg-row { |
| 381 | + &:not(.layout-lg-column) > #{$element} { @content; } |
| 382 | + } |
| 383 | + } |
| 384 | + @media (min-width: $layout-breakpoint-lg) { |
| 385 | + .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column), |
| 386 | + .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column), |
| 387 | + .layout-gt-sm-row:not(.layout-gt-md-column), |
| 388 | + .layout-gt-md-row, |
| 389 | + .layout-gt-lg-row, |
| 390 | + .layout-xl-row { |
| 391 | + &:not(.layout-gt-lg-column):not(.layout-xl-column) > #{$element} { @content; } |
| 392 | + } |
| 393 | + } |
| 394 | +} |
| 395 | + |
| 396 | +// Auto insert object margin |
| 397 | +@mixin auto-horizontal-margin($selector) { |
| 398 | + @include when-layout-row($selector) { |
| 399 | + &:not(:first-child) { |
| 400 | + @include rtl-prop(margin-left, margin-right, $default-horizontal-margin, 0); |
| 401 | + } |
| 402 | + } |
| 403 | +} |
0 commit comments