Skip to content

Commit daab67f

Browse files
committed
feat: max width and max height
1 parent 2d206ae commit daab67f

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@layouts-css/tailwindcss-plugin",
3-
"version": "1.0.2",
3+
"version": "1.1.0-alpha.1",
44
"main": "src/index.js",
55
"types": "src/index.d.ts",
66
"repository": "https://github.com/layouts-css/tailwindcss-plugin",
@@ -16,4 +16,4 @@
1616
"peerDependencies": {
1717
"tailwindcss": ">=3.0.0 || insiders"
1818
}
19-
}
19+
}

src/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ const layoutCss = withOptions((options = {}) => {
2222
flexShrink: '1',
2323
height: value,
2424
}),
25+
'w-max': (value) => ({
26+
flexGrow: '1',
27+
flexShrink: '1',
28+
maxWidth: value,
29+
}),
30+
'h-max': (value) => ({
31+
flexGrow: '1',
32+
flexShrink: '1',
33+
maxHeight: value,
34+
}),
2535
},
2636
{ values: theme('space') }
2737
);
@@ -40,6 +50,11 @@ const layoutCss = withOptions((options = {}) => {
4050
height: 'fit-content',
4151
},
4252

53+
'.w-foo': {
54+
flexGrow: '1',
55+
flexShrink: '0',
56+
maxWidth: '94rem',
57+
},
4358
'.s-hug': {
4459
width: 'fit-content',
4560
height: 'fit-content',

0 commit comments

Comments
 (0)