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.
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 thestyled
library of choice as a parameter.Something like this:
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