fbrctr / fabricator

A tool for building website UI toolkits and style guides
http://fbrctr.github.io/
MIT License
1.11k stars 124 forks source link

Use third party CSS through NPM modules #294

Open davegomez opened 7 years ago

davegomez commented 7 years ago

Is it possible to include third party CSS code through NPM modules and export it in the final CSS from the toolkit?

Or is any other automatic dependency resolution mechanism that we can use for these third party frameworks and projects?

myles commented 7 years ago

In the toolkit.scss file you can import CSS files node_modules like this:

// ./node_modules/bootstrap/dist/css/bootstrap.css
@import 'bootstrap/dist/css/bootsrap';

This will also work for SCSS files:

// ./node_modules/bourbon/app/assets/stylesheets/_bourbon.scss
@import 'bourbon/app/assets/stylesheets/bourbon';

// ./node_modules/bourbon-neat/app/assets/stylesheets/_neat.scss
@import 'bourbon-neat/app/assets/stylesheets/neat';