Skip to content

Commit

Permalink
feat: styling restructuring for multiple themes support and introduct…
Browse files Browse the repository at this point in the history
…ion of an alternative blue theme (#49, #64)

- rename the styling root 'theme' folder to 'styles'
  • Loading branch information
Sebastian-Haehnlein authored and shauke committed Jan 17, 2020
1 parent 9f53006 commit fb62ebb
Show file tree
Hide file tree
Showing 70 changed files with 642 additions and 304 deletions.
2 changes: 1 addition & 1 deletion CUSTOMIZING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ When modifying components it is most likely that related test cases will fail. I

## Styling

Changing the styling of **existing components** can be done by changing relevant information in the global style files under `src/theme`. If too many changes have to be made, it is better to **add the styling in additional files on global or component level**.
Changing the styling of **existing components** can be done by changing relevant information in the global style files under `src/styles`. If too many changes have to be made, it is better to **add the styling in additional files on global or component level**.

When styling on component level, all styling is encapsulated to exactly this component (default behavior). You can re-use variables from global styling on component level by adding imports like `@import '~theme/variables.scss';`.

Expand Down
14 changes: 13 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,24 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"extractCss": true,
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.webmanifest"
],
"styles": ["src/styles.scss"],
"styles": [
{
"input": "src/styles/themes/default/style.scss",
"lazy": true,
"bundleName": "default"
},
{
"input": "src/styles/themes/blue/style.scss",
"lazy": true,
"bundleName": "blue"
}
],
"scripts": []
},
"configurations": {
Expand Down
25 changes: 0 additions & 25 deletions src/styles.scss

This file was deleted.

6 changes: 5 additions & 1 deletion src/theme/breakpoints.scss → src/styles/breakpoints.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// bootstrap 3 breakpoints
///////////////////////////////////////////////////////////////////////////////
//
// breakpoint wrapper to match older bootstrap 3 breakpoints
//
///////////////////////////////////////////////////////////////////////////////

// Extra small screen / phone
$screen-xs: map-get($grid-breakpoints, 'xs');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 27 additions & 6 deletions src/theme/main.scss → src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
///////////////////////////////////////////////////////////////////////////////
//
// SPECIFIC THEMING MODULES
// ===========================================================
// MAIN STOREFRONT STYLING IMPORTS
//
// SET THEME SPECIFIC VARIABLES + BOOTSTRAP MAPPING (need to be imported before Bootstap)
// @import "variables";
// @import "variables-bootstrap-customized";
///////////////////////////////////////////////////////////////////////////////

//
// THIRD PARTY IMPORTS

// import Bootstrap styles
@import '~bootstrap/scss/bootstrap';

// import Font Awesome styles
@import '~@fortawesome/fontawesome-svg-core/styles';

// import Angular Toastr bootstrap styles
@import '~ngx-toastr/toastr-bs4-alert';

// import Swiper default theme
@import '~swiper/src/swiper';

//
// STYLING COMPATIBILITY LAYER

// import breakpoint wrapper to match older bootstrap 3 implementation
@import 'breakpoints';

//
// STOREFRONT SPECIFIC IMPORTS

// INCLUDE THEME SPECIFIC COMPONENTS
@import 'global/fonts/roboto';
@import 'global/animations';
@import 'global/icons';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions src/styles/themes/blue/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
///////////////////////////////////////////////////////////////////////////////
//
// THEME SPECIFIC CONFIGURATION
//
///////////////////////////////////////////////////////////////////////////////

// set theme specific variables
@import 'variables';

// import general main theme
@import '../../main';

// customizations

.logo {
background-image: url('/assets/img/logo_blue.png');
}

.mobile-logo {
background-image: url('/assets/img/logo_mobile_blue.png');
}
Loading

0 comments on commit fb62ebb

Please sign in to comment.