@mgcrea/react-native-tailwind 0.15.5 → 0.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/index.cjs +2 -0
- package/dist/parser/sizing.js +1 -1
- package/dist/parser/sizing.test.js +1 -1
- package/dist/parser/spacing.js +1 -1
- package/dist/parser/spacing.test.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.cjs.map +2 -2
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +2 -2
- package/package.json +1 -1
- package/src/parser/sizing.test.ts +10 -0
- package/src/parser/sizing.ts +1 -0
- package/src/parser/spacing.test.ts +24 -0
- package/src/parser/spacing.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgcrea/react-native-tailwind",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
4
4
|
"description": "Compile-time Tailwind CSS for React Native with zero runtime overhead",
|
|
5
5
|
"author": "Olivier Louvignes <olivier@mgcrea.io> (https://github.com/mgcrea)",
|
|
6
6
|
"homepage": "https://github.com/mgcrea/react-native-tailwind#readme",
|
|
@@ -253,6 +253,16 @@ describe("parseSizing - comprehensive coverage", () => {
|
|
|
253
253
|
expect(parseSizing("w-full")).toEqual({ width: "100%" });
|
|
254
254
|
expect(parseSizing("h-full")).toEqual({ height: "100%" });
|
|
255
255
|
});
|
|
256
|
+
|
|
257
|
+
it("should parse px (1 pixel) across all sizing utilities", () => {
|
|
258
|
+
expect(parseSizing("w-px")).toEqual({ width: 1 });
|
|
259
|
+
expect(parseSizing("h-px")).toEqual({ height: 1 });
|
|
260
|
+
expect(parseSizing("size-px")).toEqual({ width: 1, height: 1 });
|
|
261
|
+
expect(parseSizing("min-w-px")).toEqual({ minWidth: 1 });
|
|
262
|
+
expect(parseSizing("min-h-px")).toEqual({ minHeight: 1 });
|
|
263
|
+
expect(parseSizing("max-w-px")).toEqual({ maxWidth: 1 });
|
|
264
|
+
expect(parseSizing("max-h-px")).toEqual({ maxHeight: 1 });
|
|
265
|
+
});
|
|
256
266
|
});
|
|
257
267
|
|
|
258
268
|
describe("parseSizing - custom spacing", () => {
|
package/src/parser/sizing.ts
CHANGED
|
@@ -231,6 +231,30 @@ describe("parseSpacing - edge cases", () => {
|
|
|
231
231
|
expect(parseSpacing("gap-0")).toEqual({ gap: 0 });
|
|
232
232
|
});
|
|
233
233
|
|
|
234
|
+
it("should parse px (1 pixel) across all spacing utilities", () => {
|
|
235
|
+
expect(parseSpacing("m-px")).toEqual({ margin: 1 });
|
|
236
|
+
expect(parseSpacing("mx-px")).toEqual({ marginHorizontal: 1 });
|
|
237
|
+
expect(parseSpacing("my-px")).toEqual({ marginVertical: 1 });
|
|
238
|
+
expect(parseSpacing("mt-px")).toEqual({ marginTop: 1 });
|
|
239
|
+
expect(parseSpacing("mr-px")).toEqual({ marginRight: 1 });
|
|
240
|
+
expect(parseSpacing("mb-px")).toEqual({ marginBottom: 1 });
|
|
241
|
+
expect(parseSpacing("ml-px")).toEqual({ marginLeft: 1 });
|
|
242
|
+
expect(parseSpacing("ms-px")).toEqual({ marginStart: 1 });
|
|
243
|
+
expect(parseSpacing("me-px")).toEqual({ marginEnd: 1 });
|
|
244
|
+
expect(parseSpacing("p-px")).toEqual({ padding: 1 });
|
|
245
|
+
expect(parseSpacing("px-px")).toEqual({ paddingHorizontal: 1 });
|
|
246
|
+
expect(parseSpacing("py-px")).toEqual({ paddingVertical: 1 });
|
|
247
|
+
expect(parseSpacing("pt-px")).toEqual({ paddingTop: 1 });
|
|
248
|
+
expect(parseSpacing("pr-px")).toEqual({ paddingRight: 1 });
|
|
249
|
+
expect(parseSpacing("pb-px")).toEqual({ paddingBottom: 1 });
|
|
250
|
+
expect(parseSpacing("pl-px")).toEqual({ paddingLeft: 1 });
|
|
251
|
+
expect(parseSpacing("ps-px")).toEqual({ paddingStart: 1 });
|
|
252
|
+
expect(parseSpacing("pe-px")).toEqual({ paddingEnd: 1 });
|
|
253
|
+
expect(parseSpacing("gap-px")).toEqual({ gap: 1 });
|
|
254
|
+
expect(parseSpacing("-m-px")).toEqual({ margin: -1 });
|
|
255
|
+
expect(parseSpacing("-mt-px")).toEqual({ marginTop: -1 });
|
|
256
|
+
});
|
|
257
|
+
|
|
234
258
|
it("should not match partial class names", () => {
|
|
235
259
|
expect(parseSpacing("sm-4")).toBeNull();
|
|
236
260
|
expect(parseSpacing("margin-4")).toBeNull();
|