Skip to content
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2e3f353
feat: create and use Font Awesome 4 mixin.
crhallberg Oct 18, 2024
c7e204f
feat: create and use Font Awesome 6 mixin.
crhallberg Oct 18, 2024
34455cc
fix: simplify styles and implementation for Unicode icons.
crhallberg Oct 18, 2024
914d03c
refactor: use defaultSet to declutter icon mixin configs.
crhallberg Oct 18, 2024
c669fc3
chore: remove extraneous files.
crhallberg Oct 22, 2024
3b72f06
feat: add missing text icon template.
crhallberg Oct 22, 2024
76f967d
Merge remote-tracking branch 'origin/dev' into icon-mixins
crhallberg Oct 22, 2024
b5a03de
style: remove whitespace.
crhallberg Oct 22, 2024
535ec35
chore: remove vendor less and scss files.
crhallberg Oct 22, 2024
cc5ae43
Merge remote-tracking branch 'origin/dev' into icon-mixins
crhallberg Oct 22, 2024
c8b4d8b
test(icons): adjust tests to match updated Unicode icons.
crhallberg Oct 22, 2024
b68232a
chore(bs5): update BS5 scss.
crhallberg Oct 22, 2024
880122e
chore: lessToSass
crhallberg Oct 22, 2024
61dd5f6
chore: fix whitespace issue leading to differences between less and s…
crhallberg Oct 22, 2024
aeace0e
Merge remote-tracking branch 'origin/dev' into icon-mixins
crhallberg Mar 6, 2025
96e4df0
fix: missing font-awesome vendor?
crhallberg Mar 6, 2025
d5db7f2
remove: FA4.
crhallberg Mar 6, 2025
fb6139b
revert: un-upgrade some vendor libraries.
crhallberg Mar 6, 2025
3f98cd4
refactor: move basic icons to root.
crhallberg Mar 6, 2025
1b7e0ec
css(devtools): improve organization and presentation of Icons preview.
crhallberg May 1, 2025
31da54e
mixin(fa6): use npm and JS to update the Font Awesome vendor files.
crhallberg May 1, 2025
0494929
docs: improve documentation.
crhallberg May 5, 2025
baddb9f
Merge remote-tracking branch 'origin/dev' into icon-mixins
crhallberg May 5, 2025
ed94961
tests: fix expected Unicode icon class.
crhallberg May 5, 2025
0b8d625
lint
crhallberg May 5, 2025
072e19d
Merge remote-tracking branch 'origin/dev' into icon-mixins
crhallberg Sep 4, 2025
fe10f45
icons: improve icons, improve readability, remove v4 icons.
crhallberg Sep 4, 2025
00036e8
icons: check and normalize all icons. add FA7 mixin.
crhallberg Sep 4, 2025
af956a7
icons: improve devtools table
crhallberg Sep 4, 2025
b4709c8
meta: reduce diffs
crhallberg Sep 8, 2025
00e2ff1
meta: diff reduce (remove SVGs)
crhallberg Sep 8, 2025
d709a78
mixins: tool updates.
crhallberg Sep 8, 2025
0e3c7bd
fix: revert use of period class divider - messes with image sets. Ren…
crhallberg Sep 8, 2025
97c7fda
chore: php-cs-fixer
crhallberg Sep 8, 2025
7c0c700
docs: fix FontAwesome reference.
crhallberg Sep 8, 2025
928725c
Merge branch 'dev' into icon-mixins
demiankatz Oct 6, 2025
e8bdd52
Merge branch 'dev' into icon-mixins
demiankatz Oct 29, 2025
9ab07a6
Apply suggestion from @demiankatz
demiankatz Oct 29, 2025
f6ece4f
Remove obsolete icon.
demiankatz Oct 29, 2025
b54cf04
Revert name change to simplify.
demiankatz Oct 29, 2025
055f22a
Merge branch 'dev' into icon-mixins
demiankatz Jan 26, 2026
aa74aba
Merge branch 'dev' into icon-mixins
demiankatz Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
19 changes: 13 additions & 6 deletions module/VuFind/src/VuFind/View/Helper/Root/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,21 @@ protected function mapIcon(string $name, $aliasTrail = []): array
$rtl = $this->rtl ? '-rtl' : '';
$icon = $this->iconMap[$name . $rtl] ?? $this->iconMap[$name] ?? $name;
$set = $this->defaultSet;
$class = null;
$className = null;

// Override set from config (ie. FontAwesome:icon)
if (str_contains($icon, ':')) {
$parts = explode(':', $icon, 3);
$set = $parts[0];
$icon = $parts[1];
$class = $parts[2] ?? null;
$className = $parts[2] ?? null;
}

// Special case classes
if (str_contains($icon, '.')) {
$parts = explode('.', $icon, 2);
$icon = $parts[0];
$className = str_replace('.', ' ', $parts[1]);
}

// Special case: aliases:
Expand All @@ -164,7 +171,7 @@ protected function mapIcon(string $name, $aliasTrail = []): array
$template = $setConfig['template'] ?? $this->defaultTemplate;
$prefix = $setConfig['prefix'] ?? '';

return [$prefix . $icon, $set, $template, $class];
return [$prefix . $icon, $set, $template, $className];
}

/**
Expand Down Expand Up @@ -217,15 +224,15 @@ public function __invoke(string $name, $attrs = []): string
{
// Class name shortcut
if (is_string($attrs)) {
$attrs = ['class' => $attrs];
$attrs = ['className' => $attrs];
}

$cacheKey = $this->cacheKey($name, $attrs);
$cached = $this->cache->getItem($cacheKey);

if ($cached == null) {
[$icon, $set, $template, $class] = $this->mapIcon($name);
$attrs['class'] = trim(($attrs['class'] ?? '') . ' ' . $class);
[$icon, $set, $template, $className] = $this->mapIcon($name);
$attrs['className'] = trim(($attrs['className'] ?? '') . ' ' . $className);

// Surface set config and add icon and attrs
$cached = trim(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ public function testUnicodeIcons(
string|array $attrs
): void {
$helper = $this->getIconHelper();
$expected = '<span class="icon icon--font icon--unicode'
$expected = '<span class="icon icon--text icon--unicode'
. ($expectedClasses ? " $expectedClasses" : '') . '"'
. ($expectedAttrs ? " $expectedAttrs" : '')
. ' role="img" aria-hidden="true" data-icon="&#x' . $expectedIcon . ';"></span>';
. ' role="img" aria-hidden="true">&#x' . $expectedIcon . ';</span>';
$this->assertEquals($expected, trim($helper($icon, $attrs)));
}

Expand Down
2 changes: 1 addition & 1 deletion themes/bootstrap5/css/compiled.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions themes/bootstrap5/scss/components/devtools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@
text-align: left;
vertical-align: middle;
}

.icon-table {
width: fit-content;
}
7 changes: 1 addition & 6 deletions themes/bootstrap5/scss/components/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ button .icon-link__label {
* Styling by type
*/

.icon--font {
span.icon--font {
display: inline-block;
max-width: 1.25em;
height: min-content; /* FF */
Expand Down Expand Up @@ -74,10 +74,6 @@ button .icon-link__label {
vertical-align: text-bottom;
}

.icon--unicode:before {
content: attr(data-icon);
}

.show--closed,
.collapsed .show--open {
display: none;
Expand Down Expand Up @@ -141,4 +137,3 @@ button .icon-link__label {
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$exactMatchClass = ($exactMatch ?? 'unknown') . '-match';
echo '<span class="' . $exactMatchClass . '">"' . $this->escapeHtml($value) . '"</span> ' . $this->transEsc('in');
echo ' <span class="field-name" title="' . $this->escapeHtmlAttr($description) . '">';
echo $this->escapeHtml($name) . (!empty($description) ? $this->icon('question-circle') : '');
echo $this->escapeHtml($name) . (!empty($description) ? $this->icon('explain') : '');
Comment thread
demiankatz marked this conversation as resolved.
echo '</span>';
echo ($i < count($fieldName) - 1) ? ', ' : '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
></canvas>
</span>
<span title="<?=$this->transEscAttr('explain_result_list_hint')?>">
<?= $this->icon('question-circle') ?>
<?= $this->icon('explain') ?>
</span>
</a>
<?php endif; ?>
26 changes: 19 additions & 7 deletions themes/bootstrap5/templates/devtools/icon.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@
$title = $this->translate('Icons');
$titleEsc = $this->escapeHtml($title);
$this->headTitle($title);
$this->breadcrumbs()->set('Development Tools', $this->url('devtools-home'))
$this->breadcrumbs()
Comment thread
demiankatz marked this conversation as resolved.
Outdated
->set('Development Tools', $this->url('devtools-home'))
->add($title, active: true);
?>
<h1><?=$titleEsc?></h1>
<div>
<?php foreach ($aliases as $icon): ?>
<?=$this->icon($icon)?>: <?=$this->escapeHtml($icon)?><br>
<?php endforeach; ?>
</div>
<h1><?=$titleEsc ?></h1>
<table class="icon-table table table-striped">
<thead>
<tr>
<th>Alias</th>
<th>Icon</th>
</tr>
</thead>
<tbody>
<?php foreach ($aliases as $icon): ?>
<tr>
<td><?=$this->escapeHtml($icon) ?></td>
<td><?=$this->icon($icon) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
2 changes: 1 addition & 1 deletion themes/bootstrap5/templates/search/facet-list.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<?php if ($this->results->getParams()->supportsFacetFiltering($this->facet) === true): ?>
<label id="facet-lightbox-filter-label" class="form-label" for="input-contains"><?=$this->transEsc('Filter') ?></label>
<input id="input-contains" class="ajax_param form-control" data-name="contains" type="text" value="<?=htmlspecialchars($this->contains)?>" aria-label="<?=$this->transEscAttr('search_terms')?>">
<button id="btn-reset-contains" class="btn btn-default <?=strlen($this->contains) < 1 ? 'hidden' : ''?>" type="reset" aria-label="<?=$this->transEsc('searchform_reset_button')?>"><?=$this->icon('ui-reset-search')?></button>
<button id="btn-reset-contains" class="btn btn-default <?=strlen($this->contains) < 1 ? 'hidden' : ''?>" type="reset" aria-label="<?=$this->transEsc('searchform_reset_button')?>"><?=$this->icon('search-reset')?></button>
<?php endif; ?>

<?php $ajaxParams = ['facet' => $this->facet, 'facetexclude' => $this->exclude, 'facetop' => $this->operator, 'facetpage' => $this->page, 'facetsort' => $this->sort, 'urlBase' => $urlBase, 'searchAction' => $searchAction]; ?>
Expand Down
4 changes: 2 additions & 2 deletions themes/bootstrap5/templates/search/searchbox.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
type="button"
title="<?=$this->transEscAttr('searchform_reset_button')?>"
aria-label="<?=$this->transEscAttr('searchform_reset_button')?>"
><?=$this->icon('ui-reset-search');?></button>
><?=$this->icon('search-reset');?></button>
Comment thread
demiankatz marked this conversation as resolved.
Outdated
<?php if (!empty($keyboardLayouts)): ?>
<?php
$this->assetManager()->appendScriptLink('vendor/js.cookie.js');
Expand All @@ -134,7 +134,7 @@
?>
<div class="keyboard-selection dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="keyboard-selection-button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?=$this->icon('keyboard-o') ?>
<?=$this->icon('keyboard') ?>
<?=$this->icon('dropdown-caret') ?>
</button>
<ul class="dropdown-menu" aria-labelledby="keyboard-selection-button">
Expand Down
Loading
Loading