diff --git a/__tests__/fixtures/tailwind-output.css b/__tests__/fixtures/tailwind-output.css index 012fa8425..9f6dff393 100644 --- a/__tests__/fixtures/tailwind-output.css +++ b/__tests__/fixtures/tailwind-output.css @@ -2959,36 +2959,6 @@ button, margin: 2rem; } -.mt-px { - margin-top: 1px; -} - -.mr-px { - margin-right: 1px; -} - -.mb-px { - margin-bottom: 1px; -} - -.ml-px { - margin-left: 1px; -} - -.mx-px { - margin-left: 1px; - margin-right: 1px; -} - -.my-px { - margin-top: 1px; - margin-bottom: 1px; -} - -.m-px { - margin: 1px; -} - .mt-auto { margin-top: auto; } @@ -3019,6 +2989,36 @@ button, margin: auto; } +.mt-px { + margin-top: 1px; +} + +.mr-px { + margin-right: 1px; +} + +.mb-px { + margin-bottom: 1px; +} + +.ml-px { + margin-left: 1px; +} + +.mx-px { + margin-left: 1px; + margin-right: 1px; +} + +.my-px { + margin-top: 1px; + margin-bottom: 1px; +} + +.m-px { + margin: 1px; +} + .-mt-0 { margin-top: 0; } @@ -5919,36 +5919,6 @@ button, margin: 2rem; } - .sm\:mt-px { - margin-top: 1px; - } - - .sm\:mr-px { - margin-right: 1px; - } - - .sm\:mb-px { - margin-bottom: 1px; - } - - .sm\:ml-px { - margin-left: 1px; - } - - .sm\:mx-px { - margin-left: 1px; - margin-right: 1px; - } - - .sm\:my-px { - margin-top: 1px; - margin-bottom: 1px; - } - - .sm\:m-px { - margin: 1px; - } - .sm\:mt-auto { margin-top: auto; } @@ -5979,6 +5949,36 @@ button, margin: auto; } + .sm\:mt-px { + margin-top: 1px; + } + + .sm\:mr-px { + margin-right: 1px; + } + + .sm\:mb-px { + margin-bottom: 1px; + } + + .sm\:ml-px { + margin-left: 1px; + } + + .sm\:mx-px { + margin-left: 1px; + margin-right: 1px; + } + + .sm\:my-px { + margin-top: 1px; + margin-bottom: 1px; + } + + .sm\:m-px { + margin: 1px; + } + .sm\:-mt-0 { margin-top: 0; } @@ -8880,36 +8880,6 @@ button, margin: 2rem; } - .md\:mt-px { - margin-top: 1px; - } - - .md\:mr-px { - margin-right: 1px; - } - - .md\:mb-px { - margin-bottom: 1px; - } - - .md\:ml-px { - margin-left: 1px; - } - - .md\:mx-px { - margin-left: 1px; - margin-right: 1px; - } - - .md\:my-px { - margin-top: 1px; - margin-bottom: 1px; - } - - .md\:m-px { - margin: 1px; - } - .md\:mt-auto { margin-top: auto; } @@ -8940,6 +8910,36 @@ button, margin: auto; } + .md\:mt-px { + margin-top: 1px; + } + + .md\:mr-px { + margin-right: 1px; + } + + .md\:mb-px { + margin-bottom: 1px; + } + + .md\:ml-px { + margin-left: 1px; + } + + .md\:mx-px { + margin-left: 1px; + margin-right: 1px; + } + + .md\:my-px { + margin-top: 1px; + margin-bottom: 1px; + } + + .md\:m-px { + margin: 1px; + } + .md\:-mt-0 { margin-top: 0; } @@ -11841,36 +11841,6 @@ button, margin: 2rem; } - .lg\:mt-px { - margin-top: 1px; - } - - .lg\:mr-px { - margin-right: 1px; - } - - .lg\:mb-px { - margin-bottom: 1px; - } - - .lg\:ml-px { - margin-left: 1px; - } - - .lg\:mx-px { - margin-left: 1px; - margin-right: 1px; - } - - .lg\:my-px { - margin-top: 1px; - margin-bottom: 1px; - } - - .lg\:m-px { - margin: 1px; - } - .lg\:mt-auto { margin-top: auto; } @@ -11901,6 +11871,36 @@ button, margin: auto; } + .lg\:mt-px { + margin-top: 1px; + } + + .lg\:mr-px { + margin-right: 1px; + } + + .lg\:mb-px { + margin-bottom: 1px; + } + + .lg\:ml-px { + margin-left: 1px; + } + + .lg\:mx-px { + margin-left: 1px; + margin-right: 1px; + } + + .lg\:my-px { + margin-top: 1px; + margin-bottom: 1px; + } + + .lg\:m-px { + margin: 1px; + } + .lg\:-mt-0 { margin-top: 0; } @@ -14802,36 +14802,6 @@ button, margin: 2rem; } - .xl\:mt-px { - margin-top: 1px; - } - - .xl\:mr-px { - margin-right: 1px; - } - - .xl\:mb-px { - margin-bottom: 1px; - } - - .xl\:ml-px { - margin-left: 1px; - } - - .xl\:mx-px { - margin-left: 1px; - margin-right: 1px; - } - - .xl\:my-px { - margin-top: 1px; - margin-bottom: 1px; - } - - .xl\:m-px { - margin: 1px; - } - .xl\:mt-auto { margin-top: auto; } @@ -14862,6 +14832,36 @@ button, margin: auto; } + .xl\:mt-px { + margin-top: 1px; + } + + .xl\:mr-px { + margin-right: 1px; + } + + .xl\:mb-px { + margin-bottom: 1px; + } + + .xl\:ml-px { + margin-left: 1px; + } + + .xl\:mx-px { + margin-left: 1px; + margin-right: 1px; + } + + .xl\:my-px { + margin-top: 1px; + margin-bottom: 1px; + } + + .xl\:m-px { + margin: 1px; + } + .xl\:-mt-0 { margin-top: 0; } diff --git a/defaultConfig.js b/defaultConfig.js index e86b35998..19154bcd7 100644 --- a/defaultConfig.js +++ b/defaultConfig.js @@ -644,6 +644,7 @@ module.exports = { */ margin: { + 'auto': 'auto', 'px': '1px', '0': '0', '1': '0.25rem', diff --git a/docs/source/docs/spacing.blade.md b/docs/source/docs/spacing.blade.md index c93cb3565..2b8ad9f2d 100644 --- a/docs/source/docs/spacing.blade.md +++ b/docs/source/docs/spacing.blade.md @@ -49,6 +49,6 @@ For example, `.pt-2` would add `.5rem` of padding to the top of the element, `.m
6 1.5rem
8 2rem
px 1px
-
auto auto (horizontal margins only)
+
auto auto (margins only)
diff --git a/src/generators/spacing.js b/src/generators/spacing.js index eb68ddab3..f6811b325 100644 --- a/src/generators/spacing.js +++ b/src/generators/spacing.js @@ -97,31 +97,6 @@ export default function({ padding, margin, negativeMargin }) { return _.flatten([ definePadding(padding), defineMargin(margin), - defineClasses({ - 'mt-auto': { - 'margin-top': 'auto', - }, - 'mr-auto': { - 'margin-right': 'auto', - }, - 'mb-auto': { - 'margin-bottom': 'auto', - }, - 'ml-auto': { - 'margin-left': 'auto', - }, - 'mx-auto': { - 'margin-left': 'auto', - 'margin-right': 'auto', - }, - 'my-auto': { - 'margin-top': 'auto', - 'margin-bottom': 'auto', - }, - 'm-auto': { - margin: 'auto', - }, - }), defineNegativeMargin(negativeMargin), ]) }