From 6899a4913bfb41badeddf95a18131aea5cf5a49a Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Fri, 24 Nov 2017 09:42:01 -0500 Subject: [PATCH 1/2] Add pin-none utility, remove width/height from pin --- __tests__/fixtures/tailwind-output.css | 45 ++++++++++++++++++++------ src/generators/position.js | 8 +++-- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/__tests__/fixtures/tailwind-output.css b/__tests__/fixtures/tailwind-output.css index 25753fa7b..e57d27179 100644 --- a/__tests__/fixtures/tailwind-output.css +++ b/__tests__/fixtures/tailwind-output.css @@ -3413,6 +3413,13 @@ button, position: relative; } +.pin-none { + top: auto; + right: auto; + bottom: auto; + left: auto; +} + .pin-t { top: 0; } @@ -3444,8 +3451,6 @@ button, right: 0; bottom: 0; left: 0; - width: 100%; - height: 100%; } .resize-none { @@ -7252,6 +7257,13 @@ button, position: relative; } + .sm\:pin-none { + top: auto; + right: auto; + bottom: auto; + left: auto; + } + .sm\:pin-t { top: 0; } @@ -7283,8 +7295,6 @@ button, right: 0; bottom: 0; left: 0; - width: 100%; - height: 100%; } .sm\:resize-none { @@ -11092,6 +11102,13 @@ button, position: relative; } + .md\:pin-none { + top: auto; + right: auto; + bottom: auto; + left: auto; + } + .md\:pin-t { top: 0; } @@ -11123,8 +11140,6 @@ button, right: 0; bottom: 0; left: 0; - width: 100%; - height: 100%; } .md\:resize-none { @@ -14932,6 +14947,13 @@ button, position: relative; } + .lg\:pin-none { + top: auto; + right: auto; + bottom: auto; + left: auto; + } + .lg\:pin-t { top: 0; } @@ -14963,8 +14985,6 @@ button, right: 0; bottom: 0; left: 0; - width: 100%; - height: 100%; } .lg\:resize-none { @@ -18772,6 +18792,13 @@ button, position: relative; } + .xl\:pin-none { + top: auto; + right: auto; + bottom: auto; + left: auto; + } + .xl\:pin-t { top: 0; } @@ -18803,8 +18830,6 @@ button, right: 0; bottom: 0; left: 0; - width: 100%; - height: 100%; } .xl\:resize-none { diff --git a/src/generators/position.js b/src/generators/position.js index 2bc9bf186..dd5b932ef 100644 --- a/src/generators/position.js +++ b/src/generators/position.js @@ -6,6 +6,12 @@ export default function() { fixed: { position: 'fixed' }, absolute: { position: 'absolute' }, relative: { position: 'relative' }, + 'pin-none': { + top: 'auto', + right: 'auto', + bottom: 'auto', + left: 'auto', + }, 'pin-t': { top: 0 }, 'pin-r': { right: 0 }, 'pin-b': { bottom: 0 }, @@ -17,8 +23,6 @@ export default function() { right: 0, bottom: 0, left: 0, - width: '100%', - height: '100%', }, }) } From 37f5a0a0d478a4f6851c17a19e5a73e545abf61d Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Fri, 24 Nov 2017 09:56:36 -0500 Subject: [PATCH 2/2] Sort pin utilities from general to specific --- __tests__/fixtures/tailwind-output.css | 110 ++++++++++++------------- src/generators/position.js | 12 +-- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/__tests__/fixtures/tailwind-output.css b/__tests__/fixtures/tailwind-output.css index e57d27179..8f7dd4863 100644 --- a/__tests__/fixtures/tailwind-output.css +++ b/__tests__/fixtures/tailwind-output.css @@ -3420,19 +3420,10 @@ button, left: auto; } -.pin-t { +.pin { top: 0; -} - -.pin-r { right: 0; -} - -.pin-b { bottom: 0; -} - -.pin-l { left: 0; } @@ -3446,10 +3437,19 @@ button, left: 0; } -.pin { +.pin-t { top: 0; +} + +.pin-r { right: 0; +} + +.pin-b { bottom: 0; +} + +.pin-l { left: 0; } @@ -7264,19 +7264,10 @@ button, left: auto; } - .sm\:pin-t { + .sm\:pin { top: 0; - } - - .sm\:pin-r { right: 0; - } - - .sm\:pin-b { bottom: 0; - } - - .sm\:pin-l { left: 0; } @@ -7290,10 +7281,19 @@ button, left: 0; } - .sm\:pin { + .sm\:pin-t { top: 0; + } + + .sm\:pin-r { right: 0; + } + + .sm\:pin-b { bottom: 0; + } + + .sm\:pin-l { left: 0; } @@ -11109,19 +11109,10 @@ button, left: auto; } - .md\:pin-t { + .md\:pin { top: 0; - } - - .md\:pin-r { right: 0; - } - - .md\:pin-b { bottom: 0; - } - - .md\:pin-l { left: 0; } @@ -11135,10 +11126,19 @@ button, left: 0; } - .md\:pin { + .md\:pin-t { top: 0; + } + + .md\:pin-r { right: 0; + } + + .md\:pin-b { bottom: 0; + } + + .md\:pin-l { left: 0; } @@ -14954,19 +14954,10 @@ button, left: auto; } - .lg\:pin-t { + .lg\:pin { top: 0; - } - - .lg\:pin-r { right: 0; - } - - .lg\:pin-b { bottom: 0; - } - - .lg\:pin-l { left: 0; } @@ -14980,10 +14971,19 @@ button, left: 0; } - .lg\:pin { + .lg\:pin-t { top: 0; + } + + .lg\:pin-r { right: 0; + } + + .lg\:pin-b { bottom: 0; + } + + .lg\:pin-l { left: 0; } @@ -18799,19 +18799,10 @@ button, left: auto; } - .xl\:pin-t { + .xl\:pin { top: 0; - } - - .xl\:pin-r { right: 0; - } - - .xl\:pin-b { bottom: 0; - } - - .xl\:pin-l { left: 0; } @@ -18825,10 +18816,19 @@ button, left: 0; } - .xl\:pin { + .xl\:pin-t { top: 0; + } + + .xl\:pin-r { right: 0; + } + + .xl\:pin-b { bottom: 0; + } + + .xl\:pin-l { left: 0; } diff --git a/src/generators/position.js b/src/generators/position.js index dd5b932ef..84956f478 100644 --- a/src/generators/position.js +++ b/src/generators/position.js @@ -12,17 +12,17 @@ export default function() { bottom: 'auto', left: 'auto', }, - 'pin-t': { top: 0 }, - 'pin-r': { right: 0 }, - 'pin-b': { bottom: 0 }, - 'pin-l': { left: 0 }, - 'pin-y': { top: 0, bottom: 0 }, - 'pin-x': { right: 0, left: 0 }, pin: { top: 0, right: 0, bottom: 0, left: 0, }, + 'pin-y': { top: 0, bottom: 0 }, + 'pin-x': { right: 0, left: 0 }, + 'pin-t': { top: 0 }, + 'pin-r': { right: 0 }, + 'pin-b': { bottom: 0 }, + 'pin-l': { left: 0 }, }) }