How we use modular Sass at inSided


Anne Ties van Vliet

@anneties

Summary

inSided

Software as a Service to maintain communities for corporate enterprises.

Running from the cloud

We can do a little better

Time to refactor

Render Sass from one central spot

-Projects
 |-Client-name
   |-Templates
    -Assets
    -Sass
     |-Barebones-sass (repo)
      -Custom-sass
      settings.scss            
      output.scss
      styles.scss
   GruntFile.js
   bower.json
   

styles.scss

//imports this project's settings file.
@import '_settings.scss';

//ALL barebones Sass-functionality 
//without outputting any CSS.
@import '../barebones-sass/_core-importer.scss';

//imports all Sass files that will actually output CSS, 
//based on the core functionality imported above.
@import '_outputs.scss';

_settings.scss

// Which apps does the client use?
$apps : ('forum');

// brand color(s)
$color-brand                    : #006;
$color-contrast                 : #fc3;

$site-width                     : 980px;
$maincol-width                  : 100%;
$sidebar-width                  : 240px;
$gutter                         : 10px;

_core-importer.scss

@import 'global/grid';
@import 'global/typography/fonts';
@import 'global/typography/type_base';
@import 'global/typography/headers';

@import 'patterns/specific/spinner/spinner_base';
@import 'patterns/specific/seperator/seperator_base';
@import 'patterns/specific/tooltip/tooltip_base';
@import 'patterns/patterns';

output.scss

@import '../barebones-sass/patterns/spinner/spinner_output';
@import '../barebones-sass/patterns/links/links_output';
@import '../barebones-sass/patterns/forms/form-textual_output';
@import '../barebones-sass/patterns/forms/form-labels_output';
@import '../barebones-sass/patterns/forms/forms_output';
@import '../barebones-sass/patterns/avatar/avatar_output';
@import '../barebones-sass/patterns/groups/flag_output';

@import 'additions';

styles.scss

//imports this project's settings file.
@import '_settings.scss';

//ALL barebones Sass-functionality 
//without outputting any CSS.
@import '../barebones-sass/_core-importer.scss';

//imports all Sass files that will actually output CSS, 
//based on the core functionality imported above.
@import '_outputs.scss';

Grunt build

Let me show you a sass compile

Didn't you talk about a pattern library?

Discussion points

Thank you for listening

Special thanks to

Henk Jan Bouwmeester


Follow me on twitter

@anneties