Search code examples
csssasscodesandbox

How do I use Scss files in CodeSandbox?


I haven't used SASS or SCSS in anything besides codepen before so apologies if this is a basic question, but my CSS was working fine, but I wanted to nest some tags, and when I setup the SCSS and SASS dependencies and changed my filename to .scss, all of my formatting went away. I read something somewhere about importing an scss file into the css file, but I'm not really sure how to accomplish that.

Here's a link to the code sandbox: https://codesandbox.io/s/oj15rk1vw9


Solution

  • Use the Parcel Bundler template instead of the create-react-app template

    enter image description here

    Also if you're using react add react and react-dom as dependencies since the Parcel Bundler template only comes with parcel as a dev dependency

    https://codesandbox.io/s/q7877ov756