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

[BREAKING CHANGE] Support @emotion/styled #63

Open
philippefutureboy opened this issue Jan 10, 2020 · 0 comments
Open

[BREAKING CHANGE] Support @emotion/styled #63

philippefutureboy opened this issue Jan 10, 2020 · 0 comments

Comments

@philippefutureboy
Copy link

philippefutureboy commented Jan 10, 2020

Hello!

I love your little library, and I'd love to be able to leverage it in my ecosystem with @emotion.
My suggestion for the implementation would be to extract the styled component dependency from your library and offer an initialization hook of some sort that could take the styled library of choice as a parameter.

Something like this:

import styled from '@emotion/styled';
import { jsx, css } from '@emotion/core';
import { initialize } from 'styled-css-grid';

initialize({
  package: '@emotion/styled@^10',
  exports: {
    styled,
    jsx,
    css,
  }
});

And then in your code depending on the scope from the initialize function you could have a conditional that branches based on the API of the provided package.

How does that sound?

Have a great day!

Cheers,

Philippe

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

1 participant