# Skins and Styles for ILIAS
The total representation of ILIAS graphical user interface is defined by
its skin and style. The skin contains all the necessary files (CSS/SCSS, images,
icons, fonts, templates) to determine the visual appearance of ILIAS. A skin contains
one or more Styles, which may differ in colors, fonts, spacing and other visual
aspects. The default skin of ILIAS is called Delos and contains one Style also
called Delos.
## ILIAS System Style DELOS
The template folder of ILIAS contains the CSS/SCSS files and templates, which are
necessary to build the default system style of ILIAS called Delos. Due to the
new build process of ILIAS, the fonts, images and icons are no longer part of
this folder. They are now initially located in the components/ILIAS/UI/resources
folder and copied to the public/assets folder during the build process.
All template files are still located in the templates folder of each component.
All files together determine the visual appearance of ILIAS. They differ from
content styles, which allow the classes determining the appearance of
user-generated content to be adjusted.
## Custom Skins and Styles
System styles may be customized by creating custom skin and style. Custom skins
must be placed in the directory `./public/Customizing/skin`. A custom skin has
to contain at least one style and may include further sub-styles. The sub-styles
may be active for different branches of the repository.
### Tools
The ILIAS default system style called Delos is written in SCSS, which has to be
compiled using the SASS pre-processor to a CSS file that the browser can read.
For any larger scale styling project, we recommend that you consider using SASS as
well. This way, you can build on and modify all the work that has been done by the
community to style the many views and components used in ILIAS.
You may want to use the same version of SASS that is referenced in the NPM
package.json and automatically installed to `node_modules/` when using `npm install`.
This specific SASS version can be executed like this from the ILIAS root:
`node_modules/.bin/sass`
Alternatively, you can install the latest version of SASS globally with
`npm install sass -g`.
You can find a starting point for a custom System Style based on the default Delos
system style here: [Delos Repository](https://github.com/ILIAS-eLearning/delos)
At the point of writing, it does require modification to be recognized as a custom
System Style as outlined later in this document.
### Access available skins and Styles through Frontend
1. Navigate to "Administration -> Layout and Styles" of you ILIAS Installation.
2. In a table you see all available System Styles.
3. You may assign users to styles via Actions Dropdown
4. You may set Sub Styles for certain sections of the repository via Actions Dropdown
# Creating a custom skin and style
## Quick-Build from the delos repository
### Step 1: Create skin directory
If you want to create a new skin quickly, you can use the delos repository as a
starting point. To do so, first go to the directory `./public/Customizing/skin`.
```
cd ./public/Customizing/skin
```
### Step 2: Clone delos repository
Then clone the delos repository from GitHub into a new directory, e.g. `MyDelosSkin`.
Please note that the correct branch must be selected to match the ILIAS version being
used.
```
git clone https://github.com/ILIAS-eLearning/delos.git MyDelosSkin
```
### Step 3: Switch to correct branch
To switch to the correct branch you have to change into the skin directory and switch
to the branch you need, e.g. release_10 for ILIAS 10.xx:
```
cd MyDelosSkin
git switch release_10
```
### Step 4: Finish
Now the skin is ready to be used and you can activate it in the ILIAS administration.
> **Note:**
> The Delos repository contains all CSS, templates, and resource files in their latest
> versions. Template changes can lead to malfunctions, so it is recommended to update
> custom skins immediately after an ILIAS update.
> **Note:**
> It's not recommended to modify the delos.css directly. Instead, modify the SCSS files
> and compile with sass pre-processor.
## Create a custom skin from scratch
### Step 1: Create skin directory
If you want to create a new skin from scratch, you have to go to the skin directory
in the public folder. In the skin folder you have to create a new subdirectory for
your skin, e.g. MySkin.
```
cd ./public/Customizing/skin
mkdir MySkin
```
### Step 2: Create template.xml File
One file that must exist in every skin is the file template.xml. E.g.
`./public/Customizing/skin/MySkin/template.xml`. This file contains all necessary
information about the skin and its styles. An example file could look like this:
```
```
In this example a custom skin called MySkin is defined, which contains one style
called MyStyle. The style has the ID mystyle and uses the subdirectory 'images' to
store images, icons and logos.
> **Note:**
>
> Additional template parameters can be found under `Additional Information` at
> the end of this documentation.
This skin/style combination will be listed as MySkin/MyStyle in the
ILIAS Style and Layout administration. The style's files are now expected
to be located in `./public/Customizing/skin/myskin/mystyle/`:
The ILIAS administration is the place where you can activate/deactivate styles,
and where you can assign users from one skin to another.
#### Step 3.1: Create main CSS File
The `id` attribute of the style tag defines the name of the corresponding style
sheet (CSS) file, in our example `./public/Customizing/skin/myskin/mystyle/mystyle.css`.
The easiest (but not recommended) ways to get a working skin quickly are to
* copy and rename the default CSS file located at `templates/default/delos.css`
to `./public/Customizing/skin/myskin/mystyle/mystyle.css`
* or create `./public/Customizing/skin/myskin/mystyle/` and import delos in the
top line of your css like so: `@import url("../../../../assets/css/delos.css");`
If your CSS file contains references to (background) images, these images must
be present at their defined locations. If you copied the default CSS file, the
image paths will not be correct anymore. You can either copy them to your skin
directory, change the CSS definitions or provide your own image files.
#### Step 3.2: Better Alternative
To have a working directory for your skin, you can also copy the complete folder
templates/default of your ilias installation to a new folder below
`./public/Customizing/skin/myskin` within that directory, edit the file
`template.xml` to have an unique Style Name and id. This is needed to identify the
new skin in ILIAS' administration. Compile `delos.scss` or copy/rename the
standard `delos.css` file to `./public/Customizing/skin/myskin/mystyle/mystyle.css`.
Take care: the main CSS-File must reflect the style id in its name (see above).
However, best use the stand alone skin [delos](https://github.com/ILIAS-eLearning/delos)
git repo, which is always an up-to-date copy of the delos skin from the main repo.
Clone it into your `./public/Customizing/skin/myskin` folder, make your changes and
merge important fixes and updates to delos into your skin.
With this approach, you should not modify the css file, but work entirely in the scss files.
#### Step 3.3 Sass
Do not forget to re-compile the scss-file after each change. Switch to the root of your style
and execute:
```
./node_modules/.bin/sass delos.scss mystyle.css
```
or
```
./node_modules/.bin/sass --style=compressed delos.scss mystyle.css
```
for a minified CSS version.
#### Step 4: Add Icons (Optional)
If you want to replace the default icons coming with ILIAS, you can add new
representations of them to your skin. They must be stored in a subdirectory
named like the `image_directory` attribute of the style tag in the
`template.xml` file.
E.g. if you want to replace the default icon for categories
`public/assets/images/standard/icon_cat.sfg`, and your template file defines
`image_directory = "images"` as in the example above, the new version must be
stored as `./public/Customizing/skin/myskin/mystyle/images/icon_cat.svg`.
Note: Since v9 ILIAS supports suffix-specific file icons. See: https://docu.ilias.de/go/wiki/wpage_7496_1357
These files cannot be changed via the style however. If you would like to change them you can access and change/override
all of them via the ILIAS administration:
Administration / Repository and Objects / Files / File Objects: Suffix-Specific Icons
#### Step 5: Change Layout (Optional)
The layout is specified in HTML template files. Some standard default template
files can be found in directory `templates/default`. Other template files are
stored within subdirectories of the Modules or Services directories. Most ILIAS
screens use more than one template file. Some template files are reused in many
ILIAS screens (e.g. the template file that defines the layout of the main menu).
To replace a template file for your skin, you have to create a new one in your
skin directory. Please note, that your skin should only contain template files
that are modified. You do not need to copy all default template files to your
new skin.
Since ILIAS 5.3 we moved most of the UI towards the UI Components, which are
located in UI/src. To overwrite those you need to add the respective tpl files
to your skins folder.
**Examples:**
`components` related template files must be stored in a similar subdirectory
structure (omit the `templates` subdirectory). E.g. to replace the template file
`components/ILIAS/XYZ/templates/tpl.xyz.html` create a new version at
`./public/Customizing/skin/myskin/components/ILIAS/XYZ/tpl.xyz.html`. A template
of a UI Component located in `UI/src/templates/default/XYZ/tpl.xyz.html` can be
customized by creating a `./public/Customizing/skin/myskin/UI/XYZ/tpl.xyz.html` file.
The following list contains some standard template files, that are often changed in
skins:
- **Standard Layout:**
The file: `components/ILIAS/UI/src/templates/default/Layout/tpl.standardpage.html` contains the frame of the DOM for the complete ILIAS page.
> See also the according scss-variables in the folder [070-layout/UI-framework/Layout](https://github.com/ILIAS-eLearning/ILIAS/tree/release_10/templates/default/070-components/UI-framework/Layout).
- **Meta Bar:**
The file `components/ILIAS/UI/src/templates/default/MainControls/tpl.metabar.html` contains the Bar on the top holding Notification, Search User Avatar, etc.
> See also the according metabar scss-variables in the folder [070-layout/UI-framework/MainControls](https://github.com/ILIAS-eLearning/ILIAS/tree/release_10/templates/default/070-components/UI-framework/MainControls).
- **Main Bar:**
The file `components/ILIAS/UI/src/templates/default/MainControls/tpl.mainbar.html` contains the Bar on the left holding triggers for opening the slates for accessing Repository, Dasbhoard etc. Content.
> See also the according mainbar scss variables in the folder [070-layout/UI-framework/MainControls](https://github.com/ILIAS-eLearning/ILIAS/tree/release_10/templates/default/070-components/UI-framework/MainControls).
- **Slate:**
The file `components/ILIAS/UI/src/templates/default/MainControls/Slate/tpl.slate.html` contains the Slates triggered by opening items of the Main Bar.
> See also the according slate scss variables in the folder [070-layout/UI-framework/MainControls/Slate](https://github.com/ILIAS-eLearning/ILIAS/tree/release_10/templates/default/070-components/UI-framework/MainControls/Slate).
- **Breadcrumbs:**
The file `components/ILIAS/UI/src/templates/default/Breadcrumbs/tpl.breadcrumbs.html` contains Breadcrumbs working as locator on the top of the page.
> See also the breadcrumb scss variables in the folder [070-layout/UI-framework/Breadcrumbs](https://github.com/ILIAS-eLearning/ILIAS/tree/release_10/templates/default/070-components/UI-framework/Breadcrumbs).
* Startup Screens (Login, Registration, ...): `components/ILIAS/Init/templates/default/tpl .startup_screen.html`
> **Note:**
>
> We are currently working on harmonizing the template directories.
> As part of this process, we move the `/UI/src/templates/default` to `/UI/templates/default`.
#### Step 6: Change the ILIAS Icon
The main ILIAS icon is stored in the images Directory as `logo/HeaderIcon.svg`. You
can replace this easyly by your own Icon in svg format. As long as your Icon is
close to a square, this may be all that is needed. Probably you want to change
the file favicon `.ico` in ILIAS' root directory too. For non-square Icons you
may refer to:
[Installation and Maintenance » Change the ILIAS
icon](http://www.ilias.de/docu/goto_docu_pg_68691_367.html)
### Migration
There might be changes you need to consider if updating to a new ILIAS version.
Note that this changelog was introduced for ILIAS 5.3. If migrating to a lower
version you might find helpful information by consulting:
[Installation and Maintenance » Prepare for a new
skin](https://www.ilias.de/docu/goto_docu_pg_68693_367.html)
# Additional Information
The following describes the individual tags and parameters of the template.xml and how to use them.
## Template Tags
The `template.xml` file can contain the following tags:
> <template> to define a custom skin
> <style> for the skin's main style
> <substyle> to define substyles derived from the main style
### <template>-Tag
The template tag defines the skin. It must contain at least one style and can optionally include
further sub-styles. The tag must first include the namespace parameter `xmlns="http://www.w3.org"`.
It must also include the parameters `version` and `name`.
### <style>-Tag
The style tag defines the main style of the skin. This must include at least the parameters `name`,
`id`, and `image_directory`. The parameter `font_directory` and `sound_directory` can specified
if needed.
### <substyle>-Tag
The tag `` defines a substyle that depends on the main style. Like the `