-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stark-ui): expose single file (src/assets/stark-ui-bundle.scss) …
…to import all component styles/theming - updated showcase/starter - import `stark-ui-bundle.scss` - remove `_stark-styles.scss` - remove `~@angular/material/theming` from `_theme.scss` (imported with stark-ui/.../theming) - remove additional themes - refactor stark-ui/assets/*.scss - added documentation ISSUES CLOSED: #103
- Loading branch information
1 parent
bae9b8e
commit b86e190
Showing
32 changed files
with
616 additions
and
558 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Getting started | ||
|
||
The recommended way to get started with **Stark** is to download the [starter](../../starter) and run `npm install`. | ||
|
||
## Styling | ||
|
||
The starter comes with most things preconfigured and all SCSS files needed for stark-ui are imported by default via `~@nationalbankbelgium/stark-ui/assets/stark-ui-bundle`: | ||
|
||
```scss | ||
/* | ||
IMPORTANT: Stark styles are provided as SCSS styles so they should be imported in a SCSS file! | ||
*/ | ||
@import "theme"; | ||
@import "~@nationalbankbelgium/stark-ui/assets/stark-ui-bundle"; | ||
/* App */ | ||
@import "../app/app.component"; | ||
``` | ||
|
||
You can also pick and choose which parts of the Stark styling/theming you want to use. Simply remove `@import "~@nationalbankbelgium/stark-ui/assets/stark-ui-bundle";` from `src/styles/styles.scss` and import only the desired files. | ||
|
||
**IMPORTANT:** Import `base.scss` and `base-theme.scss` since these provide you with a clean basis and some basics for styling/theming your app. | ||
|
||
```scss | ||
/* | ||
IMPORTANT: Stark styles are provided as SCSS styles so they should be imported in a SCSS file! | ||
*/ | ||
@import "theme"; | ||
/* Stark styles */ | ||
@import "~@nationalbankbelgium/stark-ui/assets/styles/base"; | ||
@import "~@nationalbankbelgium/stark-ui/assets/theming/base-theme"; | ||
/* Stark component styles */ | ||
@import "~@nationalbankbelgium/stark-ui/src/modules/app-logo/components/app-logo-theme"; | ||
@import "~@nationalbankbelgium/stark-ui/src/modules/app-logo/components/app-logo.component"; | ||
/* App */ | ||
@import "../app/app.component"; | ||
``` | ||
|
||
Or you can replace the Stark styling with your own: | ||
|
||
```scss | ||
/* | ||
IMPORTANT: Stark styles are provided as SCSS styles so they should be imported in a SCSS file! | ||
*/ | ||
@import "theme"; | ||
/* Stark styles */ | ||
@import "~@nationalbankbelgium/stark-ui/assets/styles/base"; | ||
@import "~@nationalbankbelgium/stark-ui/assets/theming/base-theme"; | ||
/* Stark component styles */ | ||
@import "~@nationalbankbelgium/stark-ui/src/modules/app-logo/components/app-logo-theme"; | ||
/* Custom Stark component styles */ | ||
@import "your-custom-stark-styles/app-logo.component"; | ||
/* App */ | ||
@import "../app/app.component"; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* Stark styles */ | ||
@import "../assets/styles/base"; | ||
@import "../assets/theming/base-theme"; | ||
@import "../assets/styles/components/button"; | ||
@import "../assets/styles/components/button-theme"; | ||
@import "../assets/styles/components/icon"; | ||
@import "../assets/styles/components/card"; | ||
@import "../assets/styles/components/card-theme"; | ||
@import "../assets/styles/components/header"; | ||
@import "../assets/styles/components/header-theme"; | ||
/* Stark components */ | ||
@import "../src/modules/app-logo/components/app-logo.component"; | ||
@import "../src/modules/app-logo/components/app-logo-theme"; | ||
@import "../src/modules/app-data/components/app-data.component"; | ||
@import "../src/modules/app-data/components/app-data-theme"; | ||
@import "../src/modules/app-footer/components/app-footer.component"; | ||
@import "../src/modules/app-footer/components/app-footer-theme"; | ||
@import "../src/modules/app-menu/components/app-menu.component"; | ||
@import "../src/modules/app-menu/components/app-menu-theme"; | ||
@import "../src/modules/action-bar/components/action-bar.component"; | ||
@import "../src/modules/action-bar/components/action-bar-theme"; | ||
@import "../src/modules/app-sidebar/components/app-sidebar.component"; | ||
@import "../src/modules/app-sidebar/components/app-sidebar-theme"; | ||
@import "../src/modules/breadcrumb/components/breadcrumb.component"; | ||
@import "../src/modules/collapsible/components/collapsible.component"; | ||
@import "../src/modules/collapsible/components/collapsible-theme"; | ||
@import "../src/modules/date-range-picker/components/date-range-picker.component"; | ||
@import "../src/modules/language-selector/components/language-selector.component"; | ||
@import "../src/modules/message-pane/components/message-pane.component"; | ||
@import "../src/modules/message-pane/components/message-pane-theme"; | ||
@import "../src/modules/minimap/components/minimap.component"; | ||
@import "../src/modules/minimap/components/minimap-theme"; | ||
@import "../src/modules/slider/components/slider-theme"; | ||
@import "../src/modules/pagination/components/pagination.component"; | ||
@import "../src/modules/pagination/components/pagination-theme"; | ||
@import "../src/modules/pretty-print/components/pretty-print.component"; | ||
@import "../src/modules/table/components/table.component"; | ||
@import "../src/modules/table/components/table-theme"; | ||
@import "../src/modules/table/components/dialogs/multisort.component"; | ||
@import "../src/modules/dropdown/components/dropdown-theme"; | ||
@import "../src/modules/toast-notification/components/toast-notification.component"; | ||
@import "../src/modules/toast-notification/components/toast-notification-theme"; | ||
@import "../src/modules/dropdown/components/dropdown.component"; | ||
/* Stark session-ui pages */ | ||
@import "../src/modules/session-ui/pages/session-ui-pages"; | ||
@import "../src/modules/session-ui/pages/login/login-page.component"; | ||
@import "../src/modules/session-ui/pages/preloading/preloading-page.component"; | ||
@import "../src/modules/session-ui/pages/session-expired/session-expired-page.component"; | ||
@import "../src/modules/session-ui/pages/session-logout/session-logout-page.component"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
packages/stark-ui/assets/styles/components/_button-theme.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@mixin stark-button-color($color, $contrast) { | ||
&.mat-button, | ||
&.mat-icon-button, | ||
&.mat-stroked-button { | ||
color: $color; | ||
|
||
.mat-button-focus-overlay { | ||
background-color: rgba($color: $color, $alpha: 0.12); | ||
} | ||
|
||
.mat-ripple-element { | ||
background-color: rgba($color: $color, $alpha: 0.1); | ||
} | ||
} | ||
&.mat-flat-button, | ||
&.mat-raised-button, | ||
&.mat-fab, | ||
&.mat-mini-fab { | ||
color: $contrast; | ||
background-color: $color; | ||
|
||
.mat-ripple-element { | ||
background-color: rgba($color: $contrast, $alpha: 0.1); | ||
} | ||
} | ||
.mat-icon-button { | ||
.mat-ripple-element { | ||
background-color: rgba($color: $color, $alpha: 0.2); | ||
} | ||
} | ||
} | ||
|
||
button { | ||
&.mat-success { | ||
@include stark-button-color(mat-color($success-palette, 500), mat-contrast($success-palette, 500)); | ||
} | ||
|
||
&.mat-alert { | ||
@include stark-button-color(mat-color($alert-palette, 500), mat-contrast($alert-palette, 500)); | ||
} | ||
|
||
&.mat-alt { | ||
@include stark-button-color(mat-color($grey-palette, 900), mat-contrast($grey-palette, 900)); | ||
} | ||
|
||
&.mat-neutral { | ||
@include stark-button-color(mat-color($grey-palette, 400), mat-contrast($grey-palette, 400)); | ||
} | ||
|
||
&.mat-white { | ||
@include stark-button-color(#fff, $dark-primary-text); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.mat-button, | ||
.mat-icon-button, | ||
.mat-stroked-button, | ||
.mat-flat-button, | ||
.mat-raised-button, | ||
.mat-fab, | ||
.mat-mini-fab { | ||
text-transform: uppercase; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.mat-card.stark-card .mat-card-header { | ||
background-color: mat-color(map-get($base-theme, primary-palette), 800); | ||
color: mat-contrast(map-get($base-theme, primary-palette), 800); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/stark-ui/assets/styles/components/_header-theme.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.stark-app-header { | ||
background-color: mat-color(map-get($base-theme, primary-palette), 900); | ||
color: #fff; | ||
} |
Oops, something went wrong.