I am using the Bootstrap5 contrib theme (https://www.drupal.org/project/bootstrap5)
The contrib theme already provides the official Bootstrap 5 SVG icon Library in its dist/icons/1.11.0/icons... folder.
I have created a sub-theme called (machine name) 'bit_by_bit'
Thus, the structure of the themes folder(s) is...
/themes
-contrib
-bootstrap5
-custom
-bit_by_bit
The bootstrap contrib theme ships with the bootstrap icons in...
/themes
-contrib
-bootstrap5
-dist/icons/1.11.0/icons
I have added a themes/custom/bit_by_bit/bit_by_bit.icons.yml to my sub-theme containing...
bootstrap5_svg_icons:
enabled: true
label: "Bootstrap 5 SVG Icons"
description: "Bootstrap SVG icons supplied by the Bootstrap 5 contrib theme."
extractor: svg
config:
sources:
- ../../contrib/bootstrap5/dist/icons/1.11.0/*.svg
settings:
size:
title: "Size"
type: "integer"
default: 32
color:
title: "Color"
type: "string"
format: "color"
class:
title: "Class"
type: "string"
template: >-
<svg{{
attributes
.setAttribute('viewBox', attributes.viewBox|default('0 0 16 16'))
.setAttribute('width', size|default('32'))
.setAttribute('height', size|default('32'))
.setAttribute('aria-hidden', 'true')
.addClass(class)
}}>
{{ content }}
</svg>
I clear all caches (a few times for good measure) but the icon pack does not seem to be available.
Visiting the path: /admin/appearance/ui/icons
Yields...
TypeError: Drupal\ui_icons\IconPreview::getPreview(): Argument #1 ($icon) must be of type Drupal\Core\Theme\Icon\IconDefinitionInterface, null given, called in C:\laragon\www\bit-by-bit.org\public_html\modules\contrib\ui_icons\modules\ui_icons_library\src\Controller\LibraryIndex.php on line 159 in Drupal\ui_icons\IconPreview::getPreview() (line 34 of modules\contrib\ui_icons\src\IconPreview.php).
Drupal\ui_icons_library\Controller\LibraryIndex->buildCard(Array) (Line: 108)
Drupal\ui_icons_library\Controller\LibraryIndex->index()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 634)
Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()
Fiber->start() (Line: 635)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 745)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I have the following modules enabled:
UI Icons Fields
UI Icons for Menu
UI Icons Library
UI Icons Picker
Where I am going wrong?
Thanks all
Comments
Comment #2
sirclickalotThis has been solved by: https://www.drupal.org/i/3579927
Comment #3
mogtofu33 commentedSo I close as duplicate to keep the core issue only.