Skip to content

Commit 49fa3fe

Browse files
committed
Support arbitrary values for all margin utilities
1 parent 4b1bbf1 commit 49fa3fe

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Support arbitrary values for `transition-duration` ([#99](https://github.com/tailwindlabs/tailwindcss-jit/pull/99))
13+
- Support arbitrary values for `margin` ([#105](https://github.com/tailwindlabs/tailwindcss-jit/pull/105))
1314

1415
### Fixed
1516

src/corePlugins/margin.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const { asLength, nameClass, asValue } = require('../pluginUtils')
1+
const { asValue, nameClass } = require('../pluginUtils')
22

33
module.exports = function ({ matchUtilities, jit: { theme } }) {
44
matchUtilities({
55
m: (modifier, { theme, candidate }) => {
6-
let value = asLength(modifier, theme['margin'])
6+
let value = asValue(modifier, theme['margin'])
77

88
if (value === undefined) {
99
return []
@@ -14,7 +14,7 @@ module.exports = function ({ matchUtilities, jit: { theme } }) {
1414
})
1515
matchUtilities({
1616
mx: (modifier, { theme, candidate }) => {
17-
let value = asLength(modifier, theme['margin'])
17+
let value = asValue(modifier, theme['margin'])
1818

1919
if (value === undefined) {
2020
return []
@@ -23,7 +23,7 @@ module.exports = function ({ matchUtilities, jit: { theme } }) {
2323
return { [nameClass('mx', modifier)]: { 'margin-left': value, 'margin-right': value } }
2424
},
2525
my: (modifier, { theme, candidate }) => {
26-
let value = asLength(modifier, theme['margin'])
26+
let value = asValue(modifier, theme['margin'])
2727

2828
if (value === undefined) {
2929
return []
@@ -43,7 +43,7 @@ module.exports = function ({ matchUtilities, jit: { theme } }) {
4343
return { [nameClass('mt', modifier)]: { 'margin-top': value } }
4444
},
4545
mr: (modifier, { theme, candidate }) => {
46-
let value = asLength(modifier, theme['margin'])
46+
let value = asValue(modifier, theme['margin'])
4747

4848
if (value === undefined) {
4949
return []
@@ -52,7 +52,7 @@ module.exports = function ({ matchUtilities, jit: { theme } }) {
5252
return { [nameClass('mr', modifier)]: { 'margin-right': value } }
5353
},
5454
mb: (modifier, { theme, candidate }) => {
55-
let value = asLength(modifier, theme['margin'])
55+
let value = asValue(modifier, theme['margin'])
5656

5757
if (value === undefined) {
5858
return []
@@ -61,7 +61,7 @@ module.exports = function ({ matchUtilities, jit: { theme } }) {
6161
return { [nameClass('mb', modifier)]: { 'margin-bottom': value } }
6262
},
6363
ml: (modifier, { theme, candidate }) => {
64-
let value = asLength(modifier, theme['margin'])
64+
let value = asValue(modifier, theme['margin'])
6565

6666
if (value === undefined) {
6767
return []

0 commit comments

Comments
 (0)