Dokumentation
'Kitchen Sink'-Dokumentation von Style: 'Delos' vom Skin: 'ILIAS'
Standard
Description
- Purpose
- Standard Icons represent ILIAS Objects. In their outlined version, they are used to be layered upon a picture or if the Standard Icon should not catch too much of the users attention.
- Composition
- A Standard Icon is displayed as a block-element with a background-graphic. By default, a fallback icon will be rendered; this is until a background image is defined in the icon's CSS-class. The outlined version is the silhouette of the Standard Icon. This outlined version therefore attracts less attention.
Rivals
- Custom Icon
- Custom Icons are constructed with a path to an (uploaded) image.
Rules
- Usage
- If they are layered upon a picture, the outlined version MUST be used.
- In any other case, the non-outlined version SHOULD be used except for scenarios where the icon should not draw too much attention.
- Style
- CSS-Filters MAY be used for Standard Icons in their outlined version to manipulate the stroke to fit the context.
- In their outlined version, Standard Icons MUST only use white as color for the stroke, to make filter easily applicable.
- Accessibility
- Icons MUST have aria-labels.
Example 1: Default icon
E
E
E
LA
LA
LA
function default_icon() { global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $buffer = array(); $ico = $f->symbol()->icon()->standard('someExample', 'Example'); $ico = $ico->withAbbreviation('E'); $buffer[] = $renderer->render($ico) . ' Small Example with Short Abbreviation'; $buffer[] = $renderer->render($ico->withSize('medium')) . ' Medium Example with Short Abbreviation'; $buffer[] = $renderer->render($ico->withSize('large')) . ' Large Example with Short Abbreviation'; $ico = $f->symbol()->icon()->standard('someOtherExample', 'Example'); $ico = $ico->withAbbreviation('LA'); $buffer[] = $renderer->render($ico->withSize('small')) . ' Small Example with Long Abbreviation'; $buffer[] = $renderer->render($ico->withSize('medium')) . ' Medium Example with Long Abbreviation'; $buffer[] = $renderer->render($ico->withSize('large')) . ' Large Example with Long Abbreviation'; return implode('<br><br>', $buffer); }
Example 2: Disabled icon
function disabled_icon() { global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $buffer = array(); $ico = $f->symbol()->icon()->standard('grp', 'Group', 'large', false); $buffer[] = $renderer->render($ico) . ' Large Group Enabled'; $buffer[] = $renderer->render($ico->withDisabled(true)) . ' Large Group Disabled'; $buffer[] = $renderer->render($ico->withIsOutlined(true)) . ' Large Group Enabled Outlined'; $buffer[] = $renderer->render($ico->withDisabled(true)->withIsOutlined(true)) . ' Large Group Disabled Outlined'; return implode('<br><br>', $buffer); }
Example 3: Std course icon
function std_course_icon() { global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $buffer = array(); $ico = $f->symbol()->icon()->standard('crs', 'Course', 'small'); $buffer[] = $renderer->render($ico) . ' Small Course'; $buffer[] = $renderer->render($ico->withSize('medium')) . ' Medium Course'; $buffer[] = $renderer->render($ico->withSize('large')) . ' Large Course'; return implode('<br><br>', $buffer); }
Example 4: Std icons
tags - Tagging
function std_icons() { global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $lng = $DIC->language(); $i = $f->symbol()->icon()->standard('NONE', 'DummyIcon'); $default_icons = $i->getAllStandardHandles(); $buffer = array(); foreach ($default_icons as $icon) { $i = $f->symbol()->icon()->standard($icon, $icon, 'medium'); $buffer[] = $renderer->render($i) . ' ' . $icon . ' - ' . $lng->txt("obj_$icon"); } return implode('<br><br>', $buffer); }
Example 5: Std outlined icons
tags - Tagging
function std_outlined_icons() { global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $lng = $DIC->language(); $i = $f->symbol()->icon()->standard('NONE', 'DummyIcon'); $default_icons = $i->getAllStandardHandles(); $buffer = array(); foreach ($default_icons as $icon) { $i = $f->symbol()->icon()->standard($icon, $icon, 'medium')->withIsOutlined(true); $buffer[] = $renderer->render($i) . ' ' . $icon . ' - ' . $lng->txt("obj_$icon"); } return implode('<br><br>', $buffer); }
Relations
- Parents
- UIComponent
- Symbol
- Icon