d11 theme
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

64 lines
3.4 KiB

# druid.icons.yml — declares an icon pack for the druid theme.
#
# ─────────────────────────────────────────────────────────────────────────
# How to add a new icon
# ─────────────────────────────────────────────────────────────────────────
#
# 1. Drop the SVG into <theme>/icons/<name>.svg.
# Tips:
# - Use currentColor for stroke / fill so CSS can recolor it via
# the `color` property on the parent element.
# - Strip width / height from the <svg> root (keep viewBox); let
# CSS size the icon.
# - Source: lucide.dev is the easiest free, currentColor-ready set.
# phosphoricons.com and tablericons.com also work.
#
# 2. Reference it in any Twig template:
#
# {{ icon('druid', 'name') }}
#
# where 'name' matches the filename (without .svg). Example:
# icons/arrow-right.svg → {{ icon('druid', 'arrow-right') }}.
#
# 3. Clear cache:
#
# drush cr
#
# This is required after ADDING a new file (Drupal's icon discovery
# caches the file list). Editing an SVG file's contents does NOT
# require a cache clear during development.
#
# ─────────────────────────────────────────────────────────────────────────
# Prerequisites
# ─────────────────────────────────────────────────────────────────────────
#
# The Icon API ships with Drupal core. On Drupal 11.0 it lived in the
# `experimental_icon` module and needed enabling. On 11.1+ it's stable
# and on by default. If `{{ icon('druid', '…') }}` errors with
# "Unknown function icon", enable the core Icon module at
# /admin/modules.
#
# Schema reference:
# https://www.drupal.org/docs/develop/theming-drupal/using-the-icon-api
#
# ─────────────────────────────────────────────────────────────────────────
# The pack
# ─────────────────────────────────────────────────────────────────────────
#
# The top-level key ("druid") is the pack id — the first argument to
# every icon() call. Don't rename it without grep-replacing every usage.
druid:
label: 'Druid theme icons'
description: 'Theme-local SVG icon set. Add new icons by dropping SVGs into the theme''s icons/ directory.'
license:
name: 'ISC'
url: 'https://lucide.dev/license'
extractor: svg
# `template` is INLINE Twig source (not a file path). Wraps each icon's
# parsed inner SVG content in an outer <svg> that re-applies the
# original root attributes (viewBox, fill, stroke, …) via {{ attributes }}.
template: '<svg{{ attributes.addClass("icon").setAttribute("aria-hidden", "true") }}>{{ content|raw }}</svg>'
config:
sources:
- icons/{icon_id}.svg