medienbaecker/kirby-svg-preview 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

medienbaecker/kirby-svg-preview

最新稳定版本:1.0.1

Composer 安装命令:

composer require medienbaecker/kirby-svg-preview

包简介

Inline SVG previews and thumbnails in the Kirby Panel

README 文档

README

Renders SVG files inline in the Kirby Panel so currentColor paths follow the panel text colour instead of disappearing into the dark frame. Adds viewBox and currentColor rows to the file detail metadata, and exposes CSS variables for colour and padding.

Without this plugin, SVGs render via <img>, which doesn't propagate color into the SVG document, making currentColor paths fall back to the SVG's own default (black) and become invisible against the Panel's chequered frame (almost black).

Installation

Composer

composer require medienbaecker/kirby-svg-preview

Manual

Download and copy this repository to /site/plugins/kirby-svg-preview.

What it does

File view

The file detail view inlines the SVG and adds two SVG-specific rows to the metadata: the viewBox and whether the file uses currentColor.

File detail view with SVG-specific metadata rows

Files sections/fields

Thumbnails in files sections and fields render inline, so currentColor paths follow the surrounding text colour instead of disappearing into the dark frame.

Inline SVG thumbnails in a files section

Structure/object field

Structure and object fields use the same underlying image components.

Inline SVG previews in a structure field table

Upload dialog

The same inline rendering applies during upload, so you see the final colour before the file is saved.

Inline SVG preview while uploading a file

Customisation

Two CSS variables let you tune the previews:

:root {
  --k-svg-preview-padding: 20%; /* default */
  --k-svg-preview-color: var(--color-white); /* default */
}

Override them in your panel CSS (set via the panel.css config option) globally or scope them under any selector — e.g. .k-svg-file-preview { --k-svg-preview-padding: 5%; } to give the detail view less padding than the small thumbnails. SVGs with hardcoded fills keep their own colours; only currentColor paths respond to --k-svg-preview-color.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固