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

Is there a way to use SCSS in payload custom components while using tailwind in the frontend? #18

Closed
linobino1 opened this issue Feb 8, 2024 · 4 comments

Comments

@linobino1
Copy link
Contributor

Using @import '~payload/scss' in a .scss file that is being imported (maybe indirectly) in payload.config.ts raises an error:

Error: Can't find stylesheet to import.
    ╷
  1 │ @import "~payload/scss";
    │   
@linobino1
Copy link
Contributor Author

A simple solution: Do not use @import "~payload/scss" 😆 it will still work

@linobino1
Copy link
Contributor Author

Better solution: use @import 'payload/scss';, that gives you access to the payload variables/functions.

@xHomu
Copy link
Collaborator

xHomu commented Feb 11, 2024

The ~ tsconfig path alias tends to create compatibility issues like this, that's why a lot of Remix templates are moving toward using package.json alias instead:

https://github.com/epicweb-dev/epic-stack/blob/main/docs/decisions/026-path-aliases.md

I'll probably switch over once Typescript's adoption of this standard stabilize here microsoft/TypeScript#55015

@linobino1
Copy link
Contributor Author

linobino1 commented Feb 12, 2024 via email

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