jacksleight/bard-paragraph-style

此包已被废弃且不再维护。作者建议使用 jacksleight/statamic-bard-texstyle 包代替。
关于此包最新版本(1.2.3)没有可用的许可信息。

1.2.3 2022-05-05 09:53 UTC

This package is auto-updated.

Last update: 2022-08-15 12:40:49 UTC


README

Statamic Packagist version License

Bard Paragraph Style

⚠️ 不要使用: 此插件已被 Bard Texstyle 取代,它提供了所有这些功能以及更多。如果你已经在使用它,请 查看迁移指南

此Statamic插件允许你向Bard字段类型添加自定义段落样式。

安装

使用Composer安装插件

composer require jacksleight/bard-paragraph-style

配置

发布配置

php please vendor:publish --tag=bard-paragraph-style-config

打开 config/bard-paragraph-style.php 并添加你的段落样式

return [

    'styles' => [
        [
            'name'   => 'Introduction Paragraph',
            'ident'  => 'I',
            'class'  => 'intro',
            'button' => 'introduction',
            'cp_css' => 'font-size: 1.25em',
        ],
    ],

];

每个样式应包括

  • 名称 (字符串): 样式的名称。这将在按钮工具提示中显示。
  • 标识 (字符串): 短标识字符串(一个或两个字符)。这将在按钮图标中显示。
  • 类 (字符串): 当在网站上渲染段落元素时将应用到的类名。
  • 按钮 (字符串): 将添加到Bard字段按钮列表中的按钮名称。
  • 控制面板CSS (字符串): 将添加到此样式的控制面板的CSS属性。

最后,打开你的蓝图或fieldset YAML文件,并将按钮添加到Bard字段的按钮列表中

-
  handle: my_field
  field:
    type: bard
    buttons:
      - introduction