_grid.less 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. //
  6. // Default Grid
  7. // _____________________________________________
  8. //
  9. // Variables
  10. // _____________________________________________
  11. // Number of columns in the grid
  12. @grid-columns: 12;
  13. @grid-gutter-width: 0;
  14. // Form Fields Grid Sketch grid
  15. @temp_gutter: 30px;
  16. @temp_columns: 12;
  17. //
  18. // Row
  19. // ---------------------------------------------
  20. // Rows contain and clear the floats of your columns.
  21. .row {
  22. .make-row();
  23. }
  24. //
  25. // Columns
  26. // ---------------------------------------------
  27. // Common styles for small and large grid columns
  28. .make-grid-columns();
  29. // Extra small grid
  30. // Columns, offsets, pushes, and pulls for extra small devices like smartphones.
  31. .make-grid(xs);
  32. // Small grid
  33. // Columns, offsets, pushes, and pulls for the small device range, from phones to tablets.
  34. .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
  35. .make-grid(m);
  36. }
  37. // Medium grid
  38. // Columns, offsets, pushes, and pulls for the desktop device range.
  39. .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) {
  40. .make-grid(l);
  41. }
  42. // Large grid
  43. // Columns, offsets, pushes, and pulls for the large desktop device range.
  44. .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__xl) {
  45. .make-grid(xl);
  46. }
  47. //
  48. // Gutter
  49. // ---------------------------------------------
  50. .row-gutter {
  51. margin-left: -(@content__indent / 2);
  52. margin-right: -(@content__indent / 2);
  53. > [class*='col-'] {
  54. padding-left: @content__indent / 2;
  55. padding-right: @content__indent / 2;
  56. }
  57. }
  58. //
  59. // Form Fields Grid Sketch
  60. // _____________________________________________
  61. #mix-grid() {
  62. .row() {
  63. .lib-clearer();
  64. margin-left: ~'-@{temp_gutter}';
  65. }
  66. .return_length(@_columns-min, @_total: @temp_columns, @mathSymbol: '-') {
  67. @_part: @_columns-min/@_total;
  68. @_length: ~'calc( (100%) * @{_part} @{mathSymbol} @{temp_gutter} )';
  69. }
  70. .width(@_columns-min, @_total: @temp_columns) {
  71. #mix-grid .return_length(@_columns-min, @_total);
  72. width: @_length;
  73. }
  74. .column(@_columns-min, @_total: @temp_columns) {
  75. #mix-grid .width(@_columns-min, @_total);
  76. float: left;
  77. margin-left: @temp_gutter;
  78. }
  79. }