Skip to content

Commit

Permalink
Add test case for array fields in CSSObject; add ReadonlyArray at one…
Browse files Browse the repository at this point in the history
… more place
  • Loading branch information
Cerber-Ursi committed Dec 22, 2023
1 parent a3dfbae commit 29edb33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/serialize/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type CSSProperties = CSS.PropertiesFallback<number | string>
export type CSSPropertiesWithMultiValues = {
[K in keyof CSSProperties]:
| CSSProperties[K]
| Array<Extract<CSSProperties[K], string>>
| ReadonlyArray<Extract<CSSProperties[K], string>>
}

export type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject }
Expand Down
6 changes: 5 additions & 1 deletion packages/serialize/types/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ serializeStyles({}, {})

let cssObject: CSSObject = {
fontWeight: 400,
background: ['red'],
otherProp: ['some-value'],
':hover': {
fontWeight: 700
fontWeight: 700,
background: ['red'] as const,
otherProp: ['some-value'] as const
}
}

Expand Down

0 comments on commit 29edb33

Please sign in to comment.