Importing SCSS files from Node Modules using Jekyll

By

News

I love using jekyll and OSS to build badass web projects.

This site obviously uses tachyons.io and is built with jekyll.

First, using NPM download tachyons.

npm install tachyons-sass --save

Make sure you have a main SCSS file.

css/main.scss

That scss file should have frontmatter.

---
# Only the main Sass file needs front matter (the dashes are enough)
---
@charset "utf-8";
... the rest of your styles here

Now since you have imported tachyons from node, you can add it from the import.

---
# Only the main Sass file needs front matter (the dashes are enough)
---
@charset "utf-8";

@import "../node_modules/tachyons-sass/tachyons.scss";


Blair Anderson

Blair Anderson is the creator of Serverless Frameworks Directory and owner of Serverless Consultants.