toastnz/theme-colours 问题修复 & 功能扩展

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

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

toastnz/theme-colours

最新稳定版本:6.0.0-beta1

Composer 安装命令:

composer require toastnz/theme-colours

包简介

Silverstripe theme colours module

README 文档

README

Installation

The easiest way is to use composer:

composer require toastnz/theme-colours

Run dev/build afterwards.

Configuration

Add the following to your config.yml (optional) to generate default colours on dev/build Colours with a hex value will be locked and not editable in the CMS Colours with null value will be editable in the CMS

Toast\ThemeColours\Models:
  default_colours:
    - primary: null
    - secondary: null
    - black: '000000'
    - white: 'ffffff'

Usage

Colour functions

getColourCustomID() returns either the ID set in the config.yml, or for additional colours, returns the ID

getColourPaletteID() returns a combination of the getColourCustomID() and the Title, so the data object can be found from the selected colour palette field value.

getColourClassName() returns c- + getColourCustomID() so the css class is unique. c- is there to represent colour and to ensure the class does not start with a number.

getColourBrightness() returns either dark or light based on their luminocity of the colour value.

getColourHexCode() returns the hex value of the colour

getColourClasses() will return a combination of the getColourClassName() and getColourBrightness()

Helper functions

Helper::getThemeColourPalette() to loop through the $themeColours and add the Title and Value to the $array for ColorPaletteField to use.

Helper::getThemeColourFromColourPaletteID to loop through the $themeColours and return the object that matches the $colourPaletteID

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2023-05-19