Ground floor CSS utility classes
Import any settings before the src/index.scss file and any default settings will get overwritten:
@import
'overrides',
'src/index';
First, install the webpack deps for compiling sass. If you are using Create React App < v2.0.0 you will be using react-app-rewired if you haven't ejected and will require the following packages:
yarn add sass-loader node-sass --dev
Add the following loader to your webpack config:
{
test: /\.scss$/,
loaders: [
require.resolve('style-loader'),
require.resolve('css-loader'),
require.resolve('sass-loader'),
]
},
If you are using Create React App v2.0.0+ then SCSS modules is natively supported and you will only need to install node-sass:
yarn add node-sass --dev
Then rename your index.css file to index.scss (and be sure to change any javascript imports to import 'index.scss';). Sass should be working nicely, now!
Now you can install basement:
yarn add '@sanctucompu/basement'
And require it in index.scss like so:
@import '~@sanctucompu/basement/src/index';
Be sure that Basement, as well as Ember CLI Sass, Sass, and Broccoli Funnel are included in your devDependencies.
yarn add -D @sanctucompu/basement
yarn add -D sass ember-cli-sass broccoli-funnel
Update ember-cli-build.js. Using broccoli-funnel enables us to set the destination directory, so that the call to import 'basement/index' works as we'd expect.
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const Funnel = require('broccoli-funnel');
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
sassOptions: {
includePaths: [
new Funnel('node_modules/@sanctucompu/basement/src', { destDir: '@sanctucompu/basement' })
]
}
});
Now you can import basement in your main sass file
@import '@sanctucompu/basement/index';
Overwriting these settings is encouraged! To do so, define them in a .scss file and import them before Basement.
We want basement to be effective and effecient so we encourage contribution. You can contribute by making a pull request and requesting review from previous contributors or a member of the Sanctuary Computer team.
# clone the repo
git clone https://github.com/sanctuarycomputer/basement.git
cd basement
# Install dependancies (currently only node-sass)
yarn install
# or
npm install
# Run the watcher
yarn watch
# or the minified watch if you are pointing towards the minified build (dist/basement.min.css)
yarn watch:min
# Build before commiting
yarn build