spacing.less 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // Not part of BS3 but adding those with the intention to move to BS5
  2. // https://digital-science.slack.com/archives/C014X5MJB8S/p1650008783200769
  3. @spacers: {
  4. 0: 0;
  5. 1: @margin-xs;
  6. 2: @margin-sm;
  7. 3: @margin-md;
  8. 4: @margin-lg;
  9. 5: @margin-xl;
  10. 6: @margin-xxl;
  11. };
  12. each(@spacers, {
  13. // Margins
  14. .m-@{key} {
  15. margin: @value !important;
  16. }
  17. .ms-@{key} {
  18. margin-left: @value !important;
  19. }
  20. .me-@{key} {
  21. margin-right: @value !important;
  22. }
  23. .mt-@{key} {
  24. margin-top: @value !important;
  25. }
  26. .mb-@{key} {
  27. margin-bottom: @value !important;
  28. }
  29. .mx-@{key} {
  30. margin-left: @value !important;
  31. margin-right: @value !important;
  32. }
  33. .my-@{key} {
  34. margin-top: @value !important;
  35. margin-bottom: @value !important;
  36. }
  37. // Negative margins
  38. .m-n@{key} {
  39. margin: -@value !important;
  40. }
  41. .ms-n@{key} {
  42. margin-left: -@value !important;
  43. }
  44. .me-n@{key} {
  45. margin-right: -@value !important;
  46. }
  47. .mt-n@{key} {
  48. margin-top: -@value !important;
  49. }
  50. .mb-n@{key} {
  51. margin-bottom: -@value !important;
  52. }
  53. .mx-n@{key} {
  54. margin-left: -@value !important;
  55. margin-right: -@value !important;
  56. }
  57. .my-n@{key} {
  58. margin-top: -@value !important;
  59. margin-bottom: -@value !important;
  60. }
  61. // Paddings
  62. .p-@{key} {
  63. padding: @value !important;
  64. }
  65. .ps-@{key} {
  66. padding-left: @value !important;
  67. }
  68. .pe-@{key} {
  69. padding-right: @value !important;
  70. }
  71. .pt-@{key} {
  72. padding-top: @value !important;
  73. }
  74. .pb-@{key} {
  75. padding-bottom: @value !important;
  76. }
  77. .px-@{key} {
  78. padding-left: @value !important;
  79. padding-right: @value !important;
  80. }
  81. .py-@{key} {
  82. padding-top: @value !important;
  83. padding-bottom: @value !important;
  84. }
  85. });
  86. .m-auto {
  87. margin: auto !important;
  88. }
  89. .mx-auto {
  90. margin-left: auto !important;
  91. margin-right: auto !important;
  92. }
  93. .my-auto {
  94. margin-top: auto !important;
  95. margin-bottom: auto !important;
  96. }