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

Unable to import named cqfill function export #15

Open
JoshuaCWebDeveloper opened this issue Jan 26, 2022 · 2 comments
Open

Unable to import named cqfill function export #15

JoshuaCWebDeveloper opened this issue Jan 26, 2022 · 2 comments

Comments

@JoshuaCWebDeveloper
Copy link

The docs indicate that I should be able to manually apply the polyfill to a shadow root by importing a named export function called cqfill:

import { cqfill } from 'cqfill'

cqfill() /* cqfill(document); cqfill(shadowRoot) */

However, when I attempted to do this, Webpack gave me an error saying that cqfill had no exports. I ended up having to do the following in order to import the cqfill function:

import { cqfill } from 'node_modules/cqfill/export/cqfill.cjs'

cqfill(shadowRoot)

I ended up using another library that worked with styled-components but wanted to post this issue here in case it affects others as well. :)

@maac4422
Copy link

@JoshuaCWebDeveloper which library did you used that support styled-components?

@JoshuaCWebDeveloper
Copy link
Author

@JoshuaCWebDeveloper which library did you used that support styled-components?

I've still been using styled-container-query (example: https://github.com/samizdapp/athena/blob/07870857fae824634495a7a100f1fd052541f67f/packages/gateway-client/src/app/components/status-dashboard/box-status/box-status.tsx#L265), but it comes with some gotchas, so check out the docs on their repo.

Also check on the status of the official CSS Container Queries standard that is in the works.

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

No branches or pull requests

2 participants