Skip to content

Commit

Permalink
I think this will fix types?
Browse files Browse the repository at this point in the history
  • Loading branch information
caass committed Apr 19, 2023
1 parent efa92bb commit 84772d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {keyframes, StyleRule} from '@vanilla-extract/css'
import {compile} from 'stylis'
import {QwikStyledComponent} from './qwik-styled'
import {ClassNames} from './ve-style'

export const veClassRE = /^[a-zA-Z0-9_./]*[a-z0-9]{6}\d+$/
export const veMultiClassRE = /^([a-zA-Z0-9_./]*[a-z0-9]{6}\d+( |$)){2,}/
Expand All @@ -22,7 +24,7 @@ const changeAnimName = (rule: StyleRule, name: string, real: string) => {
}
export const css = (
tpl: TemplateStringsArray,
...expr: string[]
...expr: (StyleRule | QwikStyledComponent | ClassNames)[]
): StyleRule => {
let output = tpl[0]
for (let i = 1; i < tpl.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/qwik-styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export type Tags =

export type QwikStyledComponent<Tag extends Tags = 'div'> = FunctionComponent<
QwikIntrinsicElements[Tag]
> & {class: string} & string
> & {class: string}

export const isStyled = (o: any): o is QwikStyledComponent =>
typeof o === 'function' && 'class' in o
Expand Down

0 comments on commit 84772d6

Please sign in to comment.