Skip to content

Commit

Permalink
fix: allow string type on z-index (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal authored Aug 17, 2021
1 parent 7c28019 commit af5103e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .task/build-csstype.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const generateType = async (packageUrl) => {
.withFixedNestingSelectors
.withFixedStretchValue
.withFixedSystemColor
.withFixedZIndex

.withoutBrowserComments
.withoutImplicitGlobals
Expand Down Expand Up @@ -146,6 +147,13 @@ class ModifiedString extends String {
)
}

get withFixedZIndex() {
return this.replace(
'type ZIndex = Globals | "auto" | (number & {})',
'type ZIndex = Globals | "auto" | number | (string & {})'
)
}

// without

get withoutGenericTyping() {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/types/css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8824,7 +8824,7 @@ export namespace Property {

export type WritingMode = "horizontal-tb" | "sideways-lr" | "sideways-rl" | "vertical-lr" | "vertical-rl";

export type ZIndex = "auto" | OnlyNumber;
export type ZIndex = "auto" | OnlyStringNumeric;

export type Zoom = "normal" | "reset" | OnlyStringNumeric;

Expand Down
2 changes: 1 addition & 1 deletion packages/react/types/css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8824,7 +8824,7 @@ export namespace Property {

export type WritingMode = "horizontal-tb" | "sideways-lr" | "sideways-rl" | "vertical-lr" | "vertical-rl";

export type ZIndex = "auto" | OnlyNumber;
export type ZIndex = "auto" | OnlyStringNumeric;

export type Zoom = "normal" | "reset" | OnlyStringNumeric;

Expand Down

0 comments on commit af5103e

Please sign in to comment.