diff --git a/__tests__/fixtures/tailwind-output-flagged.css b/__tests__/fixtures/tailwind-output-flagged.css index 6ac84315c9a8..9ae18ebf40e5 100644 --- a/__tests__/fixtures/tailwind-output-flagged.css +++ b/__tests__/fixtures/tailwind-output-flagged.css @@ -1,4 +1,4 @@ -/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v2.1.1 | MIT License | https://tailwindcss.com */ /*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ @@ -7862,6 +7862,18 @@ video { background-size: contain; } +.bg-origin-border { + background-origin: border-box; +} + +.bg-origin-padding { + background-origin: padding-box; +} + +.bg-origin-content { + background-origin: content-box; +} + .border-collapse { border-collapse: collapse; } @@ -37108,6 +37120,18 @@ video { background-size: contain; } + .sm\:bg-origin-border { + background-origin: border-box; + } + + .sm\:bg-origin-padding { + background-origin: padding-box; + } + + .sm\:bg-origin-content { + background-origin: content-box; + } + .sm\:border-collapse { border-collapse: collapse; } @@ -66219,6 +66243,18 @@ video { background-size: contain; } + .md\:bg-origin-border { + background-origin: border-box; + } + + .md\:bg-origin-padding { + background-origin: padding-box; + } + + .md\:bg-origin-content { + background-origin: content-box; + } + .md\:border-collapse { border-collapse: collapse; } @@ -95330,6 +95366,18 @@ video { background-size: contain; } + .lg\:bg-origin-border { + background-origin: border-box; + } + + .lg\:bg-origin-padding { + background-origin: padding-box; + } + + .lg\:bg-origin-content { + background-origin: content-box; + } + .lg\:border-collapse { border-collapse: collapse; } @@ -124441,6 +124489,18 @@ video { background-size: contain; } + .xl\:bg-origin-border { + background-origin: border-box; + } + + .xl\:bg-origin-padding { + background-origin: padding-box; + } + + .xl\:bg-origin-content { + background-origin: content-box; + } + .xl\:border-collapse { border-collapse: collapse; } @@ -153552,6 +153612,18 @@ video { background-size: contain; } + .\32xl\:bg-origin-border { + background-origin: border-box; + } + + .\32xl\:bg-origin-padding { + background-origin: padding-box; + } + + .\32xl\:bg-origin-content { + background-origin: content-box; + } + .\32xl\:border-collapse { border-collapse: collapse; } diff --git a/__tests__/fixtures/tailwind-output-important.css b/__tests__/fixtures/tailwind-output-important.css index e928fcbfbabf..fbf1d93582ea 100644 --- a/__tests__/fixtures/tailwind-output-important.css +++ b/__tests__/fixtures/tailwind-output-important.css @@ -1,4 +1,4 @@ -/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v2.1.1 | MIT License | https://tailwindcss.com */ /*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ @@ -7862,6 +7862,18 @@ video { background-size: contain !important; } +.bg-origin-border { + background-origin: border-box !important; +} + +.bg-origin-padding { + background-origin: padding-box !important; +} + +.bg-origin-content { + background-origin: content-box !important; +} + .border-collapse { border-collapse: collapse !important; } @@ -37108,6 +37120,18 @@ video { background-size: contain !important; } + .sm\:bg-origin-border { + background-origin: border-box !important; + } + + .sm\:bg-origin-padding { + background-origin: padding-box !important; + } + + .sm\:bg-origin-content { + background-origin: content-box !important; + } + .sm\:border-collapse { border-collapse: collapse !important; } @@ -66219,6 +66243,18 @@ video { background-size: contain !important; } + .md\:bg-origin-border { + background-origin: border-box !important; + } + + .md\:bg-origin-padding { + background-origin: padding-box !important; + } + + .md\:bg-origin-content { + background-origin: content-box !important; + } + .md\:border-collapse { border-collapse: collapse !important; } @@ -95330,6 +95366,18 @@ video { background-size: contain !important; } + .lg\:bg-origin-border { + background-origin: border-box !important; + } + + .lg\:bg-origin-padding { + background-origin: padding-box !important; + } + + .lg\:bg-origin-content { + background-origin: content-box !important; + } + .lg\:border-collapse { border-collapse: collapse !important; } @@ -124441,6 +124489,18 @@ video { background-size: contain !important; } + .xl\:bg-origin-border { + background-origin: border-box !important; + } + + .xl\:bg-origin-padding { + background-origin: padding-box !important; + } + + .xl\:bg-origin-content { + background-origin: content-box !important; + } + .xl\:border-collapse { border-collapse: collapse !important; } @@ -153552,6 +153612,18 @@ video { background-size: contain !important; } + .\32xl\:bg-origin-border { + background-origin: border-box !important; + } + + .\32xl\:bg-origin-padding { + background-origin: padding-box !important; + } + + .\32xl\:bg-origin-content { + background-origin: content-box !important; + } + .\32xl\:border-collapse { border-collapse: collapse !important; } diff --git a/__tests__/fixtures/tailwind-output-no-color-opacity.css b/__tests__/fixtures/tailwind-output-no-color-opacity.css index a4b1147fd3e3..aefbe7cab27e 100644 --- a/__tests__/fixtures/tailwind-output-no-color-opacity.css +++ b/__tests__/fixtures/tailwind-output-no-color-opacity.css @@ -1,4 +1,4 @@ -/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v2.1.1 | MIT License | https://tailwindcss.com */ /*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ @@ -7010,6 +7010,18 @@ video { background-size: contain; } +.bg-origin-border { + background-origin: border-box; +} + +.bg-origin-padding { + background-origin: padding-box; +} + +.bg-origin-content { + background-origin: content-box; +} + .border-collapse { border-collapse: collapse; } @@ -33700,6 +33712,18 @@ video { background-size: contain; } + .sm\:bg-origin-border { + background-origin: border-box; + } + + .sm\:bg-origin-padding { + background-origin: padding-box; + } + + .sm\:bg-origin-content { + background-origin: content-box; + } + .sm\:border-collapse { border-collapse: collapse; } @@ -60255,6 +60279,18 @@ video { background-size: contain; } + .md\:bg-origin-border { + background-origin: border-box; + } + + .md\:bg-origin-padding { + background-origin: padding-box; + } + + .md\:bg-origin-content { + background-origin: content-box; + } + .md\:border-collapse { border-collapse: collapse; } @@ -86810,6 +86846,18 @@ video { background-size: contain; } + .lg\:bg-origin-border { + background-origin: border-box; + } + + .lg\:bg-origin-padding { + background-origin: padding-box; + } + + .lg\:bg-origin-content { + background-origin: content-box; + } + .lg\:border-collapse { border-collapse: collapse; } @@ -113365,6 +113413,18 @@ video { background-size: contain; } + .xl\:bg-origin-border { + background-origin: border-box; + } + + .xl\:bg-origin-padding { + background-origin: padding-box; + } + + .xl\:bg-origin-content { + background-origin: content-box; + } + .xl\:border-collapse { border-collapse: collapse; } @@ -139920,6 +139980,18 @@ video { background-size: contain; } + .\32xl\:bg-origin-border { + background-origin: border-box; + } + + .\32xl\:bg-origin-padding { + background-origin: padding-box; + } + + .\32xl\:bg-origin-content { + background-origin: content-box; + } + .\32xl\:border-collapse { border-collapse: collapse; } diff --git a/__tests__/fixtures/tailwind-output.css b/__tests__/fixtures/tailwind-output.css index 6ac84315c9a8..9ae18ebf40e5 100644 --- a/__tests__/fixtures/tailwind-output.css +++ b/__tests__/fixtures/tailwind-output.css @@ -1,4 +1,4 @@ -/*! tailwindcss v2.1.0 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v2.1.1 | MIT License | https://tailwindcss.com */ /*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ @@ -7862,6 +7862,18 @@ video { background-size: contain; } +.bg-origin-border { + background-origin: border-box; +} + +.bg-origin-padding { + background-origin: padding-box; +} + +.bg-origin-content { + background-origin: content-box; +} + .border-collapse { border-collapse: collapse; } @@ -37108,6 +37120,18 @@ video { background-size: contain; } + .sm\:bg-origin-border { + background-origin: border-box; + } + + .sm\:bg-origin-padding { + background-origin: padding-box; + } + + .sm\:bg-origin-content { + background-origin: content-box; + } + .sm\:border-collapse { border-collapse: collapse; } @@ -66219,6 +66243,18 @@ video { background-size: contain; } + .md\:bg-origin-border { + background-origin: border-box; + } + + .md\:bg-origin-padding { + background-origin: padding-box; + } + + .md\:bg-origin-content { + background-origin: content-box; + } + .md\:border-collapse { border-collapse: collapse; } @@ -95330,6 +95366,18 @@ video { background-size: contain; } + .lg\:bg-origin-border { + background-origin: border-box; + } + + .lg\:bg-origin-padding { + background-origin: padding-box; + } + + .lg\:bg-origin-content { + background-origin: content-box; + } + .lg\:border-collapse { border-collapse: collapse; } @@ -124441,6 +124489,18 @@ video { background-size: contain; } + .xl\:bg-origin-border { + background-origin: border-box; + } + + .xl\:bg-origin-padding { + background-origin: padding-box; + } + + .xl\:bg-origin-content { + background-origin: content-box; + } + .xl\:border-collapse { border-collapse: collapse; } @@ -153552,6 +153612,18 @@ video { background-size: contain; } + .\32xl\:bg-origin-border { + background-origin: border-box; + } + + .\32xl\:bg-origin-padding { + background-origin: padding-box; + } + + .\32xl\:bg-origin-content { + background-origin: content-box; + } + .\32xl\:border-collapse { border-collapse: collapse; } diff --git a/jit/corePlugins/backgroundOrigin.js b/jit/corePlugins/backgroundOrigin.js new file mode 100644 index 000000000000..9f6d318c2ef8 --- /dev/null +++ b/jit/corePlugins/backgroundOrigin.js @@ -0,0 +1 @@ +module.exports = require('../../lib/plugins/backgroundOrigin').default() diff --git a/jit/corePlugins/index.js b/jit/corePlugins/index.js index 63a24da91246..decf3112ea14 100644 --- a/jit/corePlugins/index.js +++ b/jit/corePlugins/index.js @@ -254,6 +254,7 @@ module.exports = { backgroundClip: require('./backgroundClip'), backgroundPosition: require('./backgroundPosition'), backgroundRepeat: require('./backgroundRepeat'), + backgroundOrigin: require('./backgroundOrigin'), fill: require('./fill'), stroke: require('./stroke'), diff --git a/jit/tests/basic-usage.test.css b/jit/tests/basic-usage.test.css index e8cb3121d2fb..784da2da1d4b 100644 --- a/jit/tests/basic-usage.test.css +++ b/jit/tests/basic-usage.test.css @@ -456,6 +456,15 @@ .bg-no-repeat { background-repeat: no-repeat; } +.bg-origin-border { + background-origin: border-box; +} +.bg-origin-padding { + background-origin: padding-box; +} +.bg-origin-content { + background-origin: content-box; +} .fill-current { fill: currentColor; } diff --git a/jit/tests/basic-usage.test.html b/jit/tests/basic-usage.test.html index f0fea67aad08..ade6904419a5 100644 --- a/jit/tests/basic-usage.test.html +++ b/jit/tests/basic-usage.test.html @@ -23,6 +23,7 @@
+ diff --git a/src/corePluginList.js b/src/corePluginList.js index 67ebc8376818..48496869ccda 100644 --- a/src/corePluginList.js +++ b/src/corePluginList.js @@ -17,6 +17,7 @@ export const corePluginList = [ 'backgroundPosition', 'backgroundRepeat', 'backgroundSize', + 'backgroundOrigin', 'borderCollapse', 'borderColor', 'borderOpacity', diff --git a/src/plugins/backgroundOrigin.js b/src/plugins/backgroundOrigin.js new file mode 100644 index 000000000000..226845271d2c --- /dev/null +++ b/src/plugins/backgroundOrigin.js @@ -0,0 +1,12 @@ +export default function () { + return function ({ addUtilities, variants }) { + addUtilities( + { + '.bg-origin-border': { 'background-origin': 'border-box' }, + '.bg-origin-padding': { 'background-origin': 'padding-box' }, + '.bg-origin-content': { 'background-origin': 'content-box' }, + }, + variants('backgroundOrigin') + ) + } +} diff --git a/src/plugins/index.js b/src/plugins/index.js index 2386bea36d01..60673fc3d5c1 100644 --- a/src/plugins/index.js +++ b/src/plugins/index.js @@ -23,6 +23,7 @@ export { default as backgroundOpacity } from './backgroundOpacity' export { default as backgroundPosition } from './backgroundPosition' export { default as backgroundRepeat } from './backgroundRepeat' export { default as backgroundSize } from './backgroundSize' +export { default as backgroundOrigin } from './backgroundOrigin' export { default as blur } from './blur' export { default as borderCollapse } from './borderCollapse' export { default as borderColor } from './borderColor' diff --git a/stubs/defaultConfig.stub.js b/stubs/defaultConfig.stub.js index 7e7b8bb1392d..8e7bed9513f8 100644 --- a/stubs/defaultConfig.stub.js +++ b/stubs/defaultConfig.stub.js @@ -841,6 +841,7 @@ module.exports = { backgroundPosition: ['responsive'], backgroundRepeat: ['responsive'], backgroundSize: ['responsive'], + backgroundOrigin: ['responsive'], blur: ['responsive'], borderCollapse: ['responsive'], borderColor: ['responsive', 'dark', 'group-hover', 'focus-within', 'hover', 'focus'],