Skip to content

Commit

Permalink
SHIBUI-811 Added documentation for changing theme
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Sep 10, 2018
1 parent 9d79770 commit 05963ad
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 8 deletions.
60 changes: 60 additions & 0 deletions ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,66 @@ For Providers and Filters, the forms in SHIB-UI are built based on the standard

[Bootstrap](http://getbootstrap.com/) 4 is used for the css framework in SHIB-UI, and provides our base theme, a responsive grid system, consistent styling across all major browsers, and pre-styled components which are connected to Angular using ng-bootstrap, a 3rd party framework.

# Customizing UI

Within the `ui > src` folder, there are two files which can be used to customize the user interface quickly.

### Color Scheme
The `Brand.scss` contains the palette information used by bootstrap to color the user interface buttons and other components. Uncomment the color you wish to override and change the hex value accordingly and rebuild the user interface.

For example:

`// $blue: #00355f;`

change to...

`$blue: #0000FF;`

If you wish to change the __"primary"__ color or any other mapping according to Bootstrap's conventions, there is a block of mappings at the bottom of the `Brand.scss` file to accomodate this as well. Uncomment and change the value allocated to the corresponding aspect of the theme you wish to change.

The supported values are:

`$brand-primary: $blue;` - The primary color used throughout the site. Default: dark blue.

`$brand-secondary: $gray-700;` - An accept color used throughout the site. Default: dark gray.

`$brand-success: $green;` - Indicates success or some other positive action. Default: green.

`$brand-info: $light-blue;` - Indicates some sort of informative text or action for the user. Default: light blue.

`$brand-warning: $yellow;` - Indicates a warning to the user. Default: yellow.

`$brand-danger: $red;` - Indicates a dangerous action or error. Default: red.

`$brand-light: $light-grey;` - Color used for accents, text, etc throughout application. Default: light grey.

`$brand-dark: $dark-grey;` - Color used for accents, text, etc throughout application. Default: dark grey.

### Logos / Footer
The `Brand.ts` contains the links, text, and image paths to modify the logos, text, and links found within the header and footer. Override the values within this Typescript file and rebuild the user interface to view changes.

For example:

`export const brand = {};`

change to...

`export const brand = {
header: 'Metadata Management'
};`

### Sitewide text
Finally, this project has support for internationalization (i18n). In the folder `backend > src > main > resources > i18n` folder there is a group of files which can be used to modify the text seen throughout the application. In order to change the default value, you can override the text in the messages_en file with the desired text.

For example:

`action.logout=Logout`

change to...

`action.logout=Sign Out`


# Development

## Scaffolding
Expand Down
13 changes: 13 additions & 0 deletions ui/src/brand.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@

// $dark-grey: #666666;
// $light-grey: #EEEEEE;

/*
*** Brand definitions
*/

// $brand-primary: $blue;
$brand-secondary: $gray-700;
$brand-success: $green;
$brand-info: $light-blue;
$brand-warning: $yellow;
$brand-danger: $red;
$brand-light: $light-grey;
$brand-dark: $dark-grey;
26 changes: 18 additions & 8 deletions ui/src/theme/_palette.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ $cyan: #17a2b8;
$dark-grey: #666666;
$light-grey: #EEEEEE;


$brand-primary: $blue;
$brand-secondary: $gray-700;
$brand-success: $green;
$brand-info: $light-blue;
$brand-warning: $yellow;
$brand-danger: $red;
$brand-light: $light-grey;
$brand-dark: $dark-grey;

@import "../brand";

$grays: (
Expand Down Expand Up @@ -60,14 +70,14 @@ $colors: (
);

$theme-colors: (
primary: $blue,
secondary: $gray-700,
success: $green,
info: $light-blue,
warning: $yellow,
danger: $red,
light: $light-grey,
dark: $dark-grey
primary: $brand-primary,
secondary: $brand-secondary,
success: $brand-success,
info: $brand-info,
warning: $brand-warning,
danger: $brand-danger,
light: $brand-light,
dark: $brand-dark
);

// Set a specific jump point for requesting color jumps
Expand Down

0 comments on commit 05963ad

Please sign in to comment.