Larave SASS importing methods

Viewed 37

i have a laravel project where i import various CSS and sass package. there are few import methods which are totally different which one is the best practice for import it. detailed information would be appreciated

  • @import '~bootstrap/sass/bootstrap'; what does ~ syntax do?
  • @import 'variables';
  • @import url('https://fonts.googleapis.com/css?family=Nunito');

can anyone explain between these different? @import "~@fortawesome/fontawesome-free/scss/fontawesome.scss";

what is the purpose of ~ and @ symbols?

1 Answers

copy your css file to /resources/assets/css/yourfile.css

add @import "../css/yourfile.css"; to the bottom of /resources/assets/sass/app.scss

If you haven't already installed the node dependencies, run npm install run npm run dev

Your custom css is now included in the /public/css/app.css file.

Related