Skip to content

Commit

Permalink
Add text-indent utilities (#5449)
Browse files Browse the repository at this point in the history
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
  • Loading branch information
reinink and adamwathan committed Sep 8, 2021
1 parent 60414f4 commit 1c10cf2
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/textIndent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import createUtilityPlugin from '../util/createUtilityPlugin'

export default function () {
return createUtilityPlugin('textIndent', [['indent', ['text-indent']]])
}
4 changes: 4 additions & 0 deletions stubs/defaultConfig.stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 6 additions & 0 deletions tests/arbitrary-values.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions tests/arbitrary-values.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<div class="rotate-[23deg] rotate-[2.3rad] rotate-[401grad] rotate-[1.5turn]"></div>
<div class="skew-x-[3px]"></div>
<div class="skew-y-[3px]"></div>
<div class="indent-[50%] indent-[var(--indent)]"></div>
<div class="text-[2.23rem]"></div>
<div class="text-[length:var(--font-size)]"></div>
<div class="text-[color:var(--color)]"></div>
Expand Down
6 changes: 6 additions & 0 deletions tests/basic-usage.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions tests/basic-usage.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
<div class="stroke-2"></div>
<div class="table-fixed"></div>
<div class="text-center"></div>
<div class="indent-6 -indent-12"></div>
<div class="text-indigo-500"></div>
<div class="underline"></div>
<div class="text-opacity-10"></div>
Expand Down

0 comments on commit 1c10cf2

Please sign in to comment.