Skip to content

Commit

Permalink
Fix issue where base styles not generated for translate transforms in…
Browse files Browse the repository at this point in the history
… JIT (#5038)
  • Loading branch information
adamwathan committed Jul 21, 2021
1 parent 81f9e94 commit a76fb7f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/plugins/translate.js
Expand Up @@ -5,8 +5,14 @@ export default function () {
if (config('mode') === 'jit') {
return createUtilityPlugin('translate', [
[
['translate-x', ['--tw-translate-x', ['transform', 'var(--tw-transform)']]],
['translate-y', ['--tw-translate-y', ['transform', 'var(--tw-transform)']]],
[
'translate-x',
[['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
],
[
'translate-y',
[['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
],
],
])({ config, ...rest })
} else {
Expand Down
4 changes: 4 additions & 0 deletions tests/jit/basic-usage.test.css
@@ -1,3 +1,7 @@
.translate-x-5,
.-translate-x-4,
.translate-y-6,
.-translate-x-3,
.rotate-3,
.skew-y-12,
.skew-x-12,
Expand Down
4 changes: 4 additions & 0 deletions tests/jit/relative-purge-paths.test.css
@@ -1,3 +1,7 @@
.translate-x-5,
.-translate-x-4,
.translate-y-6,
.-translate-x-3,
.rotate-3,
.skew-y-12,
.skew-x-12,
Expand Down

0 comments on commit a76fb7f

Please sign in to comment.