Skip to content

Please allow a space between css and ` #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
s-panferov opened this issue Oct 2, 2018 · 4 comments
Closed

Please allow a space between css and ` #235

s-panferov opened this issue Oct 2, 2018 · 4 comments

Comments

@s-panferov
Copy link
Contributor

s-panferov commented Oct 2, 2018

Do you want to request a feature or report a bug?
Bug, i think

What is the current behavior?

const style = css `background-color: red`

this chunk currently skipped by linaria because of the space between css and `

The problem is this regexp.

What is the expected behavior?

It should be properly parsed because this is a correct JavaScript code. Also TypeScript < 2.9 emits it with a space, so we cannot fix it in our legacy codebase without a painful TypeScript update, but we would like to use linaria

@s-panferov s-panferov changed the title Please allow a space between css and "`" Please allow a space between css and ` Oct 2, 2018
@satya164
Copy link
Member

satya164 commented Oct 2, 2018

Thanks for the report. I just pushed a fix with an updated regex which should handle blank space after the tag. Please let me know if it works for you.

@s-panferov
Copy link
Contributor Author

@satya164 thanks, that was quick!

@satya164
Copy link
Member

@s-panferov btw since you use typescript, can you try if this works for you? #263

@s-panferov
Copy link
Contributor Author

@satya164 wow, I'll try, but I believe that anything is better than nothing. Right now I use just

declare module 'linaria' {
	export function css(...string: any[]): string
	export function cx(...string: (string | null | undefined | false)[]): string
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants