Skip to content

Commit ae267b4

Browse files
committed
Add service_ui/skinning - documents skinning in the Service UI
taken from ManageIQ/manageiq-ui-service#235
1 parent 46f5a1f commit ae267b4

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* [Development Appliance Setup](https://github.com/ManageIQ/manageiq-appliance-dev-setup)
99
* [Developer Copr setup for CentOS6](developer_copr_setup_centos6.md)
1010
* [Internationalization Guidelines](i18n.md)
11+
* [Service UI Skinning](/service_ui/skinning.md)
1112
* [Running Changelog for Sprints](/community/changelog/)
1213
* [Roadmap and Sprints](https://github.com/ManageIQ/manageiq/milestones)
1314

service_ui/skinning.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Skinning in ManageIQ Service UI
2+
3+
## How skinning works
4+
5+
A skin is a directory containing images, styles and (js) texts, that can be linked into an Service UI instance to alter the look of the application, overriding the default theme.
6+
7+
A sample skin exists in the Service UI code base, under the `skin-sample` directory.
8+
9+
Images need to exist under the `images/` subdirectory of the skin, any image in there will override any images from `client/assets/images`. Of course, adding a new one and referencing it from the css (`url(../images/foo.png)` being the preferred way) is possible too.
10+
11+
Styles live in `*.css` files, directly in the skin directory. These get concatenated and included last.
12+
13+
To override certain hardcoded strings (currently only the product name, and the login screen branding) a skin may also contain `*.js` files, also included last, which should be used to provide an angular `constant` named `Text` in the `app.skin` module. (See `client/app/skin/skin.module.js` for details.) This feature may also be used to override other code in the application, but that is neither supported, nor recommended.
14+
15+
16+
## How to apply a skin
17+
18+
Simple! Just run `./link.sh` in the skin directory, optionally supplying the path to the Service UI directory (ie. something that includes the `client/` and `server/` subdirectories).
19+
20+
To undo this, run `./unlink.sh`.
21+
22+
What these scripts do, is to create a symlink from `client/skin` to this skin's directory.
23+
24+
All you need to do after is `gulp build`, or restart the development server.
25+
26+
27+
## How to override an image
28+
29+
Just put an identically named image in the `images/` subdirectory of the skin. It will overwrite the image copied from `client/assets/images` during the build.
30+
31+
32+
### Known images (that you may want to override)
33+
34+
For up-to-date info, please see the `client/assets/images` directory.
35+
36+
* `bg-login.png`, `bg-login-2.png` - login screen backgrounds
37+
* `bg-modal-about-pf.png` - background for the About dialog
38+
* `bg-navbar.png` - background for the top navbar
39+
* `brand.svg` - the application logo used in the navbar
40+
* `login-screen-logo.png` - login screen logo, also used in the About dialog
41+
42+
43+
## How to override a style
44+
45+
Simply add a css file in the skin, it will get included last, and so will override any identical selectors. Feel free to use `!important` but use with care.
46+
47+
48+
## How to override a text label
49+
50+
Provide a JS file that introduces an angular `constant` named `Text`. It should be an object of objects, see below for the list of fields.
51+
52+
53+
### Known labels
54+
55+
For up-to-date info, please see the `client/app/skin/skin.module.js` file.
56+
57+
* `Text.app.name` - the name of the application
58+
* `Text.login.brand` - HTML for the brand name on the login page

0 commit comments

Comments
 (0)