Skip to content

Commit

Permalink
Fix object-position arbitrary values (#5245)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc committed Aug 21, 2021
1 parent b56b4c0 commit 5d0abea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/objectPosition.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
import { asList } from '../util/pluginUtils'

export default function () {
return createUtilityPlugin('objectPosition', [['object', ['object-position']]])
return createUtilityPlugin('objectPosition', [['object', ['object-position']]], {
resolveArbitraryValue: asList,
})
}
6 changes: 6 additions & 0 deletions tests/jit/arbitrary-values.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,12 @@
.stroke-\[\#da5b66\] {
stroke: #da5b66;
}
.object-\[50\%\2c 50\%\] {
object-position: 50% 50%;
}
.object-\[top\2c right\] {
object-position: top right;
}
.object-\[var\(--position\)\] {
object-position: var(--position);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/jit/arbitrary-values.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
<div class="from-[var(--color)] via-[var(--color)] to-[var(--color)]"></div>
<div class="fill-[#da5b66]"></div>
<div class="fill-[var(--color)]"></div>
<div class="object-[50%,50%]"></div>
<div class="object-[top,right]"></div>
<div class="object-[var(--position)]"></div>
<div class="stroke-[#da5b66]"></div>
<div class="leading-[var(--leading)]"></div>
Expand Down

0 comments on commit 5d0abea

Please sign in to comment.