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
2 changes: 1 addition & 1 deletion packages/pigment-css-react/src/sx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ type GetTheme<Argument> = Argument extends { theme: infer Theme } ? Theme : neve
export type SxProp =
| CSSObjectNoCallback
| ((theme: GetTheme<ThemeArgs>) => CSSObjectNoCallback)
| ReadonlyArray<CSSObjectNoCallback | ((theme: GetTheme<ThemeArgs>) => CSSObjectNoCallback)>;
| ReadonlyArray<CSSObjectNoCallback | ((theme: GetTheme<ThemeArgs>) => CSSObjectNoCallback) | false>;

export default function sx(arg: SxProp, componentClass?: string): string;
1 change: 1 addition & 0 deletions packages/pigment-css-react/tests/sx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const sx3: SxProp = [{ color: 'red' }, { backgroundColor: 'blue', color: 'white'
const test = true;
const sx4: SxProp = [
test ? { color: 'red' } : { backgroundColor: 'blue', color: 'white' },
false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add another test to verify this?

let selected: boolean | undefined;
const sx4: SxProp = [
  selected && { color: 'red' },
]

(theme) => ({
border: `1px solid ${theme.palette.primary.main}`,
}),
Expand Down