Skip to content

Commit

Permalink
Refactor scss files (#107)
Browse files Browse the repository at this point in the history
* Fix: grunt-sass doesn't allow array for input scss files
* Add: custom_bootstrap.scss to build the custom bootstrap css
* Unify: use single quotes in scss files
  • Loading branch information
axunonb authored Aug 25, 2023
1 parent 9916431 commit 256b2e1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
12 changes: 5 additions & 7 deletions League/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ module.exports = function (grunt) {
outputStyle: 'nested' // Minify output with "compressed"
},
dist: {
files: [
{
'wwwroot/lib/bootstrap/bootstrap.css': ['Styles/bootstrap/_custom.scss', 'node_modules/bootstrap/scss/bootstrap.scss'], // "destination": "source"
'wwwroot/lib/fontawesome/fontawesome.css': 'Styles/fontawesome/fontawesome.scss',
'wwwroot/css/site.css': 'Styles/site/site.scss'
}
]
files: {
'wwwroot/lib/bootstrap/bootstrap.css': 'Styles/bootstrap/custom_bootstrap.scss', // "destination": "source" (no arrays!)
'wwwroot/lib/fontawesome/fontawesome.css': 'Styles/fontawesome/fontawesome.scss',
'wwwroot/css/site.css': 'Styles/site/site.scss'
}
}
},

Expand Down
10 changes: 5 additions & 5 deletions League/Styles/bootstrap/_custom.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Bootstrap dependencies - javascript and fonts must be copied separately
// font-awesome is included by site.scss
// This is the import file for site scss files
// which are using variables and Bootstrap functions / mixins

@import "node_modules/bootstrap/scss/functions";
@import 'node_modules/bootstrap/scss/functions';

@import './custom_variables';

@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins";
@import 'node_modules/bootstrap/scss/variables';
@import 'node_modules/bootstrap/scss/mixins';
5 changes: 4 additions & 1 deletion League/Styles/bootstrap/_custom_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Required
@import 'node_modules/bootstrap/scss/functions';

// Bootstrap variable overrides

//
Expand Down Expand Up @@ -28,7 +31,7 @@ $danger: #E401CD;
$light: $gray-100;
$dark: $gray-800;

// Reassign color vars to semantic color scheme
// Assign color vars to semantic color scheme
$theme-colors: ( 'primary': $primary, 'secondary': $secondary, 'success': $success, 'info': $info, 'warning': $warning, 'danger': $danger, 'light': $light, 'dark': $dark);

$table-bg: $light;
Expand Down
3 changes: 3 additions & 0 deletions League/Styles/bootstrap/custom_bootstrap.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Input file for the custom Bootstrap build
@import './custom_variables';
@import 'node_modules/bootstrap/scss/bootstrap';
4 changes: 1 addition & 3 deletions League/Styles/site/_std-input.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// **************************************
// Variables used locally
// **************************************
@import '../bootstrap/custom';

@import '../bootstrap/_custom';

// **************************************
// Styles
// **************************************


/**************************************************************
* START: css classes coming from jquery Unobtrousive Validation
**************************************************************/
Expand Down
4 changes: 2 additions & 2 deletions League/Styles/site/site.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../bootstrap/custom';
@import 'std-input';
@import '../bootstrap/_custom';
@import '_std-input';
@import '../fontawesome/fontawesome.scss';

$body-width: 60rem;
Expand Down

0 comments on commit 256b2e1

Please sign in to comment.