Repository navigation
Custom icon set support - #20277
Merged
Merged
Custom icon set support#20277
Conversation
Icon pickers can now include icons from custom icon sets, which are registered via craft\services\Icons::EVENT_REGISTER_ICON_SETS, or via the new customIconPath config setting (registers a "Custom" set from a directory of SVGs). Icons from custom sets are stored as set-handle:icon-name; Font Awesome icons are still stored as bare names. Icon fields get a sortable "Icon Sets" setting, and their values get a `set` property along with getSvg() and getKeywords() methods, which are also exposed via GraphQL in "Full data" mode. Refs #17101 Amp-Thread-ID: https://ampcode.com/threads/T-38d32f90-9202-488b-ac7e-a86581f667ef Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-38d32f90-9202-488b-ac7e-a86581f667ef Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-38d32f90-9202-488b-ac7e-a86581f667ef Co-authored-by: Amp <amp@ampcode.com> # Conflicts: # CHANGELOG-5.12.md # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map
brandonkelly
added a commit
that referenced
this pull request
Nov 2, 2026
Ports the 5.12 changes to 6.x: - Color fields support translucent colors: palette colors can have an alpha channel, custom colors can too via the new "Allow opacity for custom colors" setting, and ColorRule/ColorData gained alpha support plus rgba/hsla/oklch/contrast helpers. Color fields also have a "GraphQL Mode" setting with a new ColorData GraphQL type (#20274) - Custom icon sets (#20277): a `customIconPath` config setting, CraftCms\Cms\Cp\IconSets with an IconSetsResolving event, an "Icon Sets" Icon field setting, `set-handle:icon-name` values, and icon picker results grouped by set. The Yii2 adapter provides craft\services\Icons, RegisterIconSetsEvent, and craft\icons\* shims - "Save as a new draft" carries nested entries over to the new draft, keeping modified-field tracking for doubly nested edits (#20226) 5.x's jQuery IconPicker/ColorInput, Twig templates, and Yii controllers were deleted in 6.x, so their changes were ported to the Vue/Lit components, UI controls, and Laravel controllers instead. The pinned CDT time zone test has no 6.x counterpart, and composer.json already allowed php-http/discovery. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-a65e3cbd-ffa2-4795-ab74-481b29563ebe
Contributor
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Icon pickers can now include custom icon sets alongside Font Awesome. Resolves the request in #17101.
Evidence
Icon field settings: new sortable “Icon Sets” setting
Icon picker modal
Entry edit page: custom icons in an Icon field and Button Group option icons
GraphQL (one field in each mode, against a real install)
Tests: new
tests/unit/services/IconsTest.php(12 tests) covers value parsing (Windows paths, aliases, and SVG markup aren’t treated asset:icon),customIconPathregistration and rendering, Icon field value round-tripping,getSvg()/getKeywords(), and Icon Sets validation.Related issues