1# Theme customization
2Customization of the application requires knowledge of Sass and CSS. It also
3will require becoming familiar with the Bootstrap and Bootstrap-Vue component
4libraries. This section outlines the global options and variables that can be
5removed or updated to meet organizational brand guidelines.
6
7## Environment specific builds
8Any organization can create a build that meets their branding and other
9customization needs. This includes customization of the state store, routing,
10application navigation, and theming.
11
12[Read more in the Build Customization section](/customization/build)
13
14### Configuring environment specific builds
15The complete instructions can be found in the `env` directory in a file called
16env.md or by viewing the [Configuring environment specific builds
17page](./env.md)
18
19## Bootstrap Sass Options
20The Bootstrap Sass options are global styling toggles. The naming convention for
21these built-in variables is `enabled-*`.
22
23### $enable-rounded
24This option enables or disables the border-radius styles on various components.
25
26- Set to `false` to remove rounded corners on all container elements and buttons
27
28### $enable-validation-icons
29This option enables or disables background-image icons within textual inputs and
30some custom forms for validation states.
31
32- Set to `false` due to inability to style icons using CSS
33
34### More information
35- [View all the Bootstrap Sass
36  Options](https://getbootstrap.com/docs/4.2/getting-started/theming/#sass-options)
37
38## Bootstrap Sass Variables
39These are global variables that Bootstrap defines in the
40`/node_modules/bootstrap/scss/variables.scss` helper file. Adding a variable
41listed in this file to the `/src/assets/styles/bmc/helpers/_variables.scss` file
42will override the Bootstrap defined value.
43
44### $transition-base
45This variable sets the base CSS transition style throughout the application.
46- Set to `all $duration--moderate-02 $standard-easing--productive`
47
48### $transition-fade
49This variable sets the transition when showing and hiding elements.
50
51- Set to `opacity $duration--moderate-01 $standard-easing--productive`
52
53### $transition-collapse
54This variable sets the CSS transitions throughout the application when expanding
55and collapsing elements.
56
57- Set to `height $duration--slow-01 $standard-easing--expressive`
58
59### More Information
60- [Carbon Design System Motion
61  Guidelines](https://www.carbondesignsystem.com/guidelines/motion/basics/)
62- [Including Animation In Your Design
63  System](https://www.smashingmagazine.com/2019/02/animation-design-system/)
64
65## OpenBMC Custom Sass Options
66
67### $responsive-layout-bp
68This variable determines when the primary navigation is hidden and when the
69hamburger menu is displayed. The breakpoint is defined using a Bootstrap
70function that only accepts a key from the Bootstrap `$grid-breakpoints` map.
71
72- xs - Navigation is always displayed
73- sm - Navigation displayed when the viewport is greater than 576px
74- md - Navigation displayed when the viewport is greater than 768px
75- lg - Navigation displayed when the viewport is greater than 992px
76- xl - Navigation displayed when the viewport is less than 1200px
77
78#### Responsive Resources
79- [Bootstrap responsive
80  breakpoints](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)
81- [Bootstrap Sass
82  Mixins](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)
83- [Customizing the Bootstrap
84  Grid](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints)
85
86### $header-height
87This variable determines the height of the OpenBMC Web UI header element.
88
89- Default value: 56px
90
91### $navigation-width
92This variable determines the width of the primary navigation menu when expanded.
93
94- Default value: 300px
95
96### $container-bgd
97This option sets the background of page containers. Changing the value of this
98variable will change the background color for the following elements:
99-  Login page
100- Primary navigation section
101- Quick links section on the overview page
102
103#### Value
104- Default value: $gray-200
105
106### $primary-nav-hover
107The semantic naming of this variable identifies its purpose. This color should
108always be slightly darker than the `$container-bgd` value.
109
110- Default value: $gray-300
111
112## Updating Colors
113Supporting a different color palette is a simple process. The default color
114palette is supported using the Sass variables outlined in the color guidelines
115and color maps outlined in the theme's overview.  The following sections provide
116directions to update the settings to meet your organization's needs.
117
118### Color
119The OpenBMC Web UI uses Sass variables and maps to build its layout and
120components. Bootstrap variables and maps use the `!default` flag to allow for
121overrides. There are three Sass maps created to establish the color palette.
122These include the `color` map, `theme-color` map, and `gray` map. These maps are
123used by Bootstrap to build the application's CSS stylesheets.
124
125#### All Colors
126The OpenBMC Web UI custom colors are available as Sass variables and a Sass map
127in `/src/assets/styles/bmc/helpers/_variables.scss`. The OpenBMC theme only
128requires a subset of the colors to create the look and feel of the application.
129Adding, removing, or updating the color variables and map is how the application
130color palette can be customized. Using these variables outside of the helper
131files is discouraged to avoid tightly coupling the OpenBMC Web UI theme to
132specific colors.
133
134The `color` map is not as important as the `theme-color` map. A tight-coupling
135of the Sass variable name to the color name makes it hard to use the `color` map
136keys for customization. Using these keys in Sass stylesheets or single-file
137components is discouraged.
138
139#### Theme Colors
140The theme color variables and the `theme-color` map consist of a subset of the
141color variables. This smaller color palette creates a scheme that is not
142dependent on specific colors like blue or green. Several of the Bootstrap
143`theme-color` map keys are required to generate the CSS styles. The OpenBMC Web
144UI `theme-color` map has the same keys as the Bootstrap `theme-color` map with
145custom values.
146
147The `theme-color` map is used heavily throughout the application. The
148Bootstrap-Vue components `variant` prop also utilizes the `theme-color` map.
149This map is the key to customizing the application's color palette. Take a look
150at the [color guidelines](/guide/guidelines/colors) to better understand default
151theme-colors map.
152
153#### Gray Colors
154The gray color palette contains nine shades of gray that range from light to
155dark. Bootstrap sets a default gray color value for each color variable from
156100-900 in increments of one hundred, for example, `$gray-100`, `$gray-200`,
157`$gray-300` through `gray-900`. Bootstrap does not create a color map for any of
158the colors except gray. The Bootstrap documentation indicates that adding color
159maps for all the default colors is scheduled to be delivered in a future patch.
160The OpenBMC Web UI color theme overrides all shades of the Bootstrap default
161gray variable values.
162
163[Learn more about Bootstrap
164colors](https://getbootstrap.com/docs/4.0/getting-started/theming/#color)
165
166### Bootstrap Color Functions
167- `color('<color map key>)`
168- `theme-color('<theme color map key>)`
169- `gray('<gray color palette key'>)`
170
171
172#### Example
173```SCSS
174.some-selector {
175  color: color("blue");
176  background: theme-color("light");
177  border: 1px solid gray("900")
178}
179```
180
181[Learn more about using Bootstrap
182functions](https://getbootstrap.com/docs/4.0/getting-started/theming/#functions)
183## Adding a logo
184The updated page header can include a small logo. The guidelines for adding a
185logo and the suggested logo dimensions are currently in progress. It may be
186challenging to meet all organization brand guidelines due to the minimal height
187of the page header. The company logo might be able to be set in the primary
188navigation, but a design supporting that option will be the focus of future
189design work.
190