Skip to content

Commit e160bc0

Browse files
committed
chore(ui): polish config file
1 parent c5eb1ad commit e160bc0

1 file changed

Lines changed: 21 additions & 14 deletions

File tree

fractal.config.js

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,34 @@ const path = require('path');
44
const mandelbrot = require('@frctl/mandelbrot');
55
const minimist = require('minimist');
66

7-
const { getStaticFilePath } = require( __dirname + '/bin/get-path.js');
7+
// Get base config
8+
const fractal = require('@tacc/core-styles/fractal.config.js');
9+
const themeConfig = require('@tacc/core-styles/fractal.theme.js');
810

11+
// Get project
12+
// (name)
13+
const { getStaticFilePath } = require( __dirname + '/bin/get-path.js');
914
const args = minimist( process.argv.slice( 2 ));
1015
let projectName = args['project'] || '';
1116
projectName = ( projectName !== 'core-cms' ) ? projectName : '';
17+
// (stylesheet)
1218
const projectCSSFile = projectName
1319
? path.join( '/', getStaticFilePath( projectName, 'css/build/site.css'))
1420
: null;
1521

16-
const fractal = require('@tacc/core-styles/fractal.config.js');
17-
const themeConfig = require('@tacc/core-styles/fractal.theme.js');
18-
19-
const theme = mandelbrot( Object.assign( themeConfig, {
20-
skin: Object.assign( themeConfig.skin, {
21-
links: '#877453',
22-
})
23-
}));
24-
22+
// Get base path
2523
const coreStylesRoot = path.join(
2624
path.dirname( require.resolve('@tacc/core-styles')),
27-
// The '../' exits 'src/' which require.resolve returns a file from
25+
// The '../' exits 'src/' which is at the end of what require.resolve returns
2826
'../'
2927
);
3028

29+
// Set source paths
30+
// (for components)
3131
fractal.components.set('path',
3232
path.join( coreStylesRoot, 'src/lib/_imports')
3333
);
34+
// (for stylesheets)
3435
fractal.components.set('default.context', {
3536
styles: {
3637
external: {
@@ -47,11 +48,17 @@ if ( projectCSSFile ) {
4748
fractal.cli.log(`+ Included CSS for "${projectName}": '${projectCSSFile}'`);
4849
}
4950

50-
fractal.web.set('static.path',
51-
path.join( coreStylesRoot, 'dist')
52-
);
51+
// Set website paths
52+
fractal.web.set('static.path', path.join( coreStylesRoot, 'dist'));
5353
fractal.web.set('builder.dest', __dirname + '/taccsite_ui');
5454

55+
// Customize theme
56+
const theme = mandelbrot( Object.assign( themeConfig, {
57+
skin: Object.assign( themeConfig.skin, {
58+
links: '#877453',
59+
})
60+
}));
5561
fractal.web.theme( theme );
5662

63+
// Export
5764
module.exports = fractal;

0 commit comments

Comments
 (0)