verbb / icon-picker

A Craft CMS field to select SVG or font icons from a folder for use in your content.
Other
17 stars 8 forks source link

Configure width/height of preview #44

Closed ctigelaar closed 2 years ago

ctigelaar commented 3 years ago

I'm trying out your plugin and really like it so far. But one thing I notice is that the preview of SVG icons in the dropdown is pretty small. Especially when using icons designed for +-56px. They get sized down to 32px in the list view, what makes it harder to distinguish the details between the icons. What I would like is to be able to configure the size of the preview on a global or field base.

What's your proposed solution? Make the width CSS property of the .icon-picker-item-icon configurable, as wel as the width and height CSS properties of .icon-picker-item. It can be a setting in the settings of the plugin or on per-field basis in the field configuration.

I tried to override the CSS properties locally (72px for the width/height of the .icon-picker-item and 56px for the width of .icon-picker-item-icon) and this solution would be perfect for bigger SVG's. I don't know what happens to icon fonts, but as long as the default stays 32px for those it shouldn't be a problem IMO.

engram-design commented 3 years ago

I think this should be possible, and maybe I can introduce a conversion factor for icon fonts.

The Icon Picker itself will be getting a full rewrite in 2.0, so I'll be sure to bundle this in!

engram-design commented 2 years ago

Added in 2.0.0