Skip to content
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

Fixes #682: Replace to-style with style-to-object dependency #683

Merged
merged 2 commits into from
Jul 31, 2019

Conversation

pedrolamas
Copy link
Contributor

This fixes any CSS parsing issues shown in to-style by using a proper parser

@vercel
Copy link

vercel bot commented Jul 24, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@vercel vercel bot temporarily deployed to staging July 24, 2019 17:20 Inactive
@johno
Copy link
Member

johno commented Jul 24, 2019

Thanks for opening up a PR! 🕺 🙏

I'm wondering if this would be best achieved as an optional plugin since postcss is a pretty big dependency for something we don't expect to encounter very often 🤔. If we ran it at the rehype stage (as an optional plugin) we'd be able to properly convert the style strings.

Also, have you given style-to-object a try? It might be more robust and is what hast-to-hyperscript uses.

@pedrolamas
Copy link
Contributor Author

No proble, I'll take a look into style-to-object! To be fair, something else was already referencing postcss in my repo, hence why I choose to go with that!

@johno
Copy link
Member

johno commented Jul 24, 2019

Wonderful, thanks for taking a look! Feel free to report back if you hit any bumpy spots.

@vercel vercel bot temporarily deployed to staging July 24, 2019 22:52 Inactive
@pedrolamas
Copy link
Contributor Author

@johno it's done! But I had to take a dependency on camelcase-css to ensure we convert the CSS properties to their correct javascript/jsx names

@pedrolamas pedrolamas changed the title Fixes #682: Replace to-style with postcss dependency Fixes #682: Replace to-style with style-to-object dependency Jul 24, 2019
@johno johno merged commit c0a416f into mdx-js:master Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants