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

import styles from #57

Open
iamdangavin opened this issue Jun 29, 2023 · 1 comment
Open

import styles from #57

iamdangavin opened this issue Jun 29, 2023 · 1 comment

Comments

@iamdangavin
Copy link

Am I missing something? You have import styles from 'figma-plugin-ds/dist/figma-plugin-ds.css' listed in the documentation, but that file isn't a module.css file so it comes back undefined if you console.log the styles export and if you try and use it in your code with {styles.button} or something it throws caught TypeError: Cannot read properties of undefined (reading 'button')

@kevinramharak
Copy link

This depends on the bundler you are using as stated in the example you are referencing:

//You could also inport the css via a CSS Loader in your JS environment (refer to syntax of whatever loader you are using)
import styles

For example, some tools will require a side effect import like:

import 'figma-plugin-ds/dist/figma-plugin-ds.css'

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