function micon_template_preprocess_micon_package__font in Micon 8
Same name and namespace in other branches
- 2.x micon.theme.inc \micon_template_preprocess_micon_package__font()
Prepares variables for Micon package templates of type ICON.
File
- ./
micon.theme.inc, line 94 - Contains micon.theme.inc.
Code
function micon_template_preprocess_micon_package__font(&$variables) {
$micon = $variables['micon'];
$info = $micon
->getInfo();
$variables['content']['use'] = [
'#theme' => 'fieldset',
'#title' => t('Usage Information'),
];
$variables['content']['use']['#children']['details'] = [
'#markup' => '<textarea rows="13" class="micon-usage">
/* use !important to prevent issues with browser extensions that change fonts */
font-family: \'' . $info['metadata']['name'] . '\' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;</textarea>',
'#allowed_tags' => [
'textarea',
],
];
$variables['content']['icons'] = [
'#theme' => 'fieldset',
'#title' => t('Available Icons'),
];
$variables['content']['icons']['#children']['icons'] = [
'#theme' => 'micon_icon_list',
'#micon' => $micon,
];
}