carbon/colorvalues

Neos CMS 的一个插件,提供具有颜色值的编辑器

安装量: 7,871

依赖项: 1

建议者: 0

安全性: 0

星级: 5

关注者: 2

分支: 0

开放问题: 0

语言:JavaScript

类型:neos-carbon

1.2.1 2024-03-21 15:23 UTC

This package is auto-updated.

Last update: 2024-09-21 16:22:45 UTC


README

Latest stable version Total downloads License GitHub forks GitHub stars GitHub watchers

介绍

此包提供了一种颜色值编辑器,可以在 Neos CMS 中使用。

它受到 Shel.Neos.ColorPicker 的启发,但不同之处在于不是颜色值被保存,而是给定的键。它仅提供颜色列表,没有其他功能。

示例

example

安装

在您的站点包中运行以下命令

composer require --no-update carbon/colorvalues

然后在您的项目目录中运行 composer update

如何使用

添加一个字符串类型的属性,并按照此示例配置编辑器

Foo.Bar:Content.Text:
  properties:
    color:
      type: string
      ui:
        label: Color
        reloadIfChanged: true
        inspector:
          editor: Carbon.ColorValues/Editor
          editorOptions:
            disabled: false
            # If set, this color gets displayed if no value is set
            placeholder: gold
            # Hides the reset button if set to false
            allowEmpty: true
            # Set a custom label for the reset button
            resetLabel: Custom label
            values:
              main:
                label: Primary
                color: '#95c11f'
              gray:
                label: Gray
                color: gray
              transparent:
                label: Transparent
                color: transparent
              disabledColor:
                label: Disabled color
                color: red
                disabled: true

如果颜色设置为 transparent,则对特殊处理进行颜色预览和选择字段;在这种情况下,会渲染一个棋盘格。

贡献

欢迎贡献!

请创建详细的 issue 和 PR。