diff --git a/src/plugins/index.js b/src/plugins/index.js index 6f032470feff..dcf316ca16fe 100644 --- a/src/plugins/index.js +++ b/src/plugins/index.js @@ -109,6 +109,7 @@ export { default as objectPosition } from './objectPosition' export { default as padding } from './padding' export { default as textAlign } from './textAlign' +export { default as textIndent } from './textIndent' export { default as verticalAlign } from './verticalAlign' export { default as fontFamily } from './fontFamily' export { default as fontSize } from './fontSize' diff --git a/src/plugins/textIndent.js b/src/plugins/textIndent.js new file mode 100644 index 000000000000..e7c191695053 --- /dev/null +++ b/src/plugins/textIndent.js @@ -0,0 +1,5 @@ +import createUtilityPlugin from '../util/createUtilityPlugin' + +export default function () { + return createUtilityPlugin('textIndent', [['indent', ['text-indent']]]) +} diff --git a/stubs/defaultConfig.stub.js b/stubs/defaultConfig.stub.js index 1d35b870e817..8be05ea55c75 100644 --- a/stubs/defaultConfig.stub.js +++ b/stubs/defaultConfig.stub.js @@ -712,6 +712,10 @@ module.exports = { 2: '2', }, textColor: (theme) => theme('colors'), + textIndent: (theme, { negative }) => ({ + ...theme('spacing'), + ...negative(theme('spacing')), + }), textOpacity: (theme) => theme('opacity'), transformOrigin: { center: 'center', diff --git a/tests/arbitrary-values.test.css b/tests/arbitrary-values.test.css index 9a71955d09bc..0a4b2ab8a18b 100644 --- a/tests/arbitrary-values.test.css +++ b/tests/arbitrary-values.test.css @@ -312,6 +312,12 @@ .p-\[var\(--app-padding\)\] { padding: var(--app-padding); } +.indent-\[50\%\] { + text-indent: 50%; +} +.indent-\[var\(--indent\)\] { + text-indent: var(--indent); +} .text-\[2\.23rem\] { font-size: 2.23rem; } diff --git a/tests/arbitrary-values.test.html b/tests/arbitrary-values.test.html index 6ed12b90bbe5..5945c1dfff6f 100644 --- a/tests/arbitrary-values.test.html +++ b/tests/arbitrary-values.test.html @@ -54,6 +54,7 @@
+
diff --git a/tests/basic-usage.test.css b/tests/basic-usage.test.css index ed8994f40be5..e78a9b0a7c87 100644 --- a/tests/basic-usage.test.css +++ b/tests/basic-usage.test.css @@ -570,6 +570,12 @@ .text-center { text-align: center; } +.indent-6 { + text-indent: 1.5rem; +} +.-indent-12 { + text-indent: -3rem; +} .align-middle { vertical-align: middle; } diff --git a/tests/basic-usage.test.html b/tests/basic-usage.test.html index 3301be4dc451..18e239879050 100644 --- a/tests/basic-usage.test.html +++ b/tests/basic-usage.test.html @@ -149,6 +149,7 @@
+