Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,17 @@ eslintTester.run('stylex-valid-shorthands', rule.default, {
})
`,
},
// grid-area: single-value custom-ident
{
code: `
import * as stylex from '@stylexjs/stylex';
const styles = stylex.create({
main: {
gridArea: 'header',
},
})
`,
},
// Already-longhand grid properties
{
code: `
Expand Down Expand Up @@ -1532,34 +1543,6 @@ eslintTester.run('stylex-valid-shorthands', rule.default, {
},
],
},
// grid-area: custom-ident expands to 4 longhands
{
code: `
import * as stylex from '@stylexjs/stylex';
const styles = stylex.create({
main: {
gridArea: 'header',
},
});
`,
output: `
import * as stylex from '@stylexjs/stylex';
const styles = stylex.create({
main: {
gridColumnEnd: 'header',
gridColumnStart: 'header',
gridRowEnd: 'header',
gridRowStart: 'header',
},
});
`,
errors: [
{
message:
'Property shorthands using multiple values like "gridArea: header" are not supported in StyleX. Separate into individual properties.',
},
],
},
// grid-area: custom-ident with 2 slash-separated parts
{
code: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const stylexValidShorthands = {
return;
}

if (key === 'flex' && isSingleToken(String(v))) {
if ((key === 'flex' || key === 'gridArea') && isSingleToken(String(v))) {
return;
}

Expand Down
Loading