13
13
var path = require ( 'path' ) ,
14
14
pug = require ( 'pug' ) ,
15
15
through = require ( 'through2' ) ,
16
+ concat = require ( 'concat-files' ) ,
16
17
gulp = require ( 'gulp' ) ,
17
18
rename = require ( 'gulp-rename' ) ,
18
19
mustache = require ( 'gulp-mustache' ) ,
@@ -37,6 +38,7 @@ var path = require('path'),
37
38
addSection = require ( './modules/helpers/add-section' ) ,
38
39
sgServer = require ( './server' ) ,
39
40
distPath = path . join ( __dirname , 'dist' ) ,
41
+ libPath = path . join ( __dirname , 'lib' ) ,
40
42
fileHashes = { } ,
41
43
pugCache ,
42
44
sgOptions , // global object for options
@@ -150,7 +152,7 @@ function replaceSectionReferences(json) {
150
152
}
151
153
152
154
function copyUsedOptionsToJsonConfig ( opt , json ) {
153
- var used = [ 'appRoot' , 'extraHead' , 'beforeBody' , 'afterBody' , 'commonClass' , 'title' , 'disableEncapsulation' , 'disableHtml5Mode' , 'readOnly' , 'sideNav' , 'afterSections' , 'showMarkupSection' , 'hideSubsectionsOnMainSection' , 'additionalNgDependencies' ] ;
155
+ var used = [ 'appRoot' , 'extraHead' , 'beforeBody' , 'afterBody' , 'commonClass' , 'title' , 'disableEncapsulation' , 'disableHtml5Mode' , 'readOnly' , 'sideNav' , 'afterSections' , 'showMarkupSection' , 'hideSubsectionsOnMainSection' , 'excludeDefaultStyles' , ' additionalNgDependencies'] ;
154
156
json . config = { } ;
155
157
used . forEach ( function ( prop ) {
156
158
json . config [ prop ] = _ . cloneDeep ( opt [ prop ] ) ;
@@ -329,7 +331,18 @@ module.exports.generate = function(options) {
329
331
overviewProcessed ,
330
332
filesCopied ,
331
333
favIcon ,
332
- indexHtmlProcessed ;
334
+ indexHtmlProcessed ,
335
+ srcFiles ;
336
+
337
+ srcFiles = [ distPath + '/css/_fontpath_and_mixin_definition.css' ] ;
338
+
339
+ if ( ! opt . excludeDefaultStyles ) {
340
+ srcFiles . push ( distPath + '/css/_styleguide_default_styles.css' ) ;
341
+ }
342
+
343
+ srcFiles . push ( distPath + '/css/_custom_styles_mixin.css' ) ;
344
+ concat ( srcFiles , libPath + '/app/css/styleguide-app.css' ) ;
345
+ concat ( srcFiles , distPath + '/css/styleguide-app.css' ) ;
333
346
334
347
overviewProcessed = processOverviewMarkdown ( opt ) ;
335
348
var cssSrc = [ distPath + '/css/styleguide-app.css' , distPath + '/css/styleguide_helper_elements.css' ] ;
@@ -339,7 +352,7 @@ module.exports.generate = function(options) {
339
352
//gulp.src([distPath + '/**', '!' + distPath + '/index.html', + '!' + distPath + '**/*.css'])
340
353
var copySrc = [ distPath + '/**' , '!' + distPath + '/index.html' ] ;
341
354
342
- copySrc = copySrc . concat ( cssSrc . map ( function ( item ) {
355
+ copySrc = copySrc . concat ( cssSrc . map ( function ( item ) {
343
356
return '!' + item ;
344
357
} ) ) ;
345
358
0 commit comments