Skip to content

Commit

Permalink
Interpolate size (#775)
Browse files Browse the repository at this point in the history
* Add interpolateSize to Eslint and types
* Add test case for interpolateSize
  • Loading branch information
nikeee authored Nov 20, 2024
1 parent 93fd979 commit d980195
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/eslint-plugin/__tests__/stylex-valid-styles-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,15 @@ eslintTester.run('stylex-valid-styles', rule.default, {
'containIntrinsicSize': 'auto 300px',
},
})`,
`import stylex from "stylex";
stylex.create({
a: {
interpolateSize: 'numeric-only',
},
b: {
interpolateSize: 'allow-keywords',
},
})`,
`import stylex from "stylex";
stylex.create({
default: {
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-plugin/src/stylex-valid-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ const imeMode = makeUnionRule(
const initialLetter = makeUnionRule(makeLiteralRule('normal'), isString);
const initialLetterAlign = isString;
const inlineSize = width;
const interpolateSize = makeUnionRule('allow-keywords', 'numeric-only');
const isolation = makeUnionRule(
makeLiteralRule('auto'),
makeLiteralRule('isolate'),
Expand Down Expand Up @@ -1917,6 +1918,8 @@ const CSSProperties = {
blockSize: blockSize,
inlineSize: inlineSize,

interpolateSize: interpolateSize,

maxHeight: maxHeight,
maxWidth: maxWidth,
maxBlockSize: maxBlockSize,
Expand Down
3 changes: 3 additions & 0 deletions packages/stylex/src/StyleXCSSTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ type imeMode = 'auto' | 'normal' | 'active' | 'inactive' | 'disabled';
type initialLetter = 'normal' | string;
type initialLetterAlign = string;
type inlineSize = width;
type interpolateSize = 'allow-keywords' | 'numeric-only';
type isolation = 'auto' | 'isolate';
type justifyContent =
| 'center'
Expand Down Expand Up @@ -1243,6 +1244,8 @@ export type CSSProperties = $ReadOnly<{
initialLetterAlign?: all | initialLetterAlign,
inlineSize?: all | inlineSize,

interpolateSize?: all | interpolateSize,

inset?: all | number | string,
insetBlock?: all | number | string,
insetBlockEnd?: all | number | string,
Expand Down

0 comments on commit d980195

Please sign in to comment.