Skip to content

Commit 330e81c

Browse files
authored
fix: allow width/height 'auto' value (#144)
1 parent 9959c87 commit 330e81c

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

src/__tests__/vendor/tailwind/accessibility.test.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@ describe("Accessibility - Screen Readers", () => {
2626
expect(result).toStrictEqual({
2727
props: {
2828
style: {
29+
height: "auto",
2930
margin: 0,
3031
overflow: "visible",
3132
padding: 0,
3233
position: "static",
34+
width: "auto",
3335
},
3436
},
3537
warnings: {
3638
properties: ["clip", "white-space"],
37-
values: {
38-
width: "auto",
39-
height: "auto",
40-
},
4139
},
4240
});
4341
});

src/__tests__/vendor/tailwind/sizing.test.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ describe("Sizing - Width", () => {
3030
});
3131
test("w-auto", async () => {
3232
expect(await renderCurrentTest()).toStrictEqual({
33-
props: {},
34-
warnings: { values: { width: "auto" } },
33+
props: { style: { width: "auto" } },
3534
});
3635
});
3736
test("w-min", async () => {
@@ -149,8 +148,7 @@ describe("Sizing - Height", () => {
149148
});
150149
test("h-auto", async () => {
151150
expect(await renderCurrentTest()).toStrictEqual({
152-
props: {},
153-
warnings: { values: { height: "auto" } },
151+
props: { style: { height: "auto" } },
154152
});
155153
});
156154
test("h-min", async () => {
@@ -268,8 +266,7 @@ describe("Sizing - Size", () => {
268266
});
269267
test("size-auto", async () => {
270268
expect(await renderCurrentTest()).toStrictEqual({
271-
props: {},
272-
warnings: { values: { width: "auto", height: "auto" } },
269+
props: { style: { width: "auto", height: "auto" } },
273270
});
274271
});
275272
test("size-min", async () => {

src/compiler/declarations.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ const parsers: {
174174
"font-variant-caps": parseFontVariantCapsDeclaration,
175175
"font-weight": parseFontWeightDeclaration,
176176
"gap": parseGap,
177-
"height": parseSizeDeclaration,
178-
"inline-size": parseSizeDeclaration,
177+
"height": parseSizeWithAutoDeclaration,
178+
"inline-size": parseSizeWithAutoDeclaration,
179179
"inset": parseInset,
180180
"inset-block": parseInsetBlock,
181181
"inset-block-end": parseLengthPercentageDeclaration,
@@ -247,7 +247,7 @@ const parsers: {
247247
"user-select": parseUserSelect,
248248
"vertical-align": parseVerticalAlign,
249249
"visibility": parseVisibility,
250-
"width": parseSizeDeclaration,
250+
"width": parseSizeWithAutoDeclaration,
251251
"z-index": parseZIndex,
252252
};
253253

0 commit comments

Comments
 (0)