silverstripe / colorpicker
Color picker fields built in react
Installs: 15 482
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 8
Forks: 5
Open Issues: 16
Language:JavaScript
Type:silverstripe-vendormodule
Requires
- silverstripe/framework: ^4.1 || ^5.0
Requires (Dev)
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ^3
- dev-master / 1.x-dev
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/tmpl-1.0.5
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/merge-2.1.1
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/handlebars-4.7.7
- dev-dependabot/npm_and_yarn/ua-parser-js-0.7.28
- dev-dependabot/npm_and_yarn/ssri-6.0.2
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/npm-user-validate-1.0.1
This package is auto-updated.
Last update: 2024-11-25 09:43:12 UTC
README
This module adds a color picker field which can be used anywhere in the CMS.
In order to keep the site accessible, custom color selection is not implemented.
Installation
To install this module, you can do so with Composer:
composer require silverstripe/colorpicker
Usage
You can use the ColorPickerField
as follows:
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab( 'Root.Main', [ ColorPickerField::create( 'MyColorField', _t( __CLASS__ . '.MyColorField', 'My Color Field' ), [ [ 'Title' => 'Red', 'CSSClass' => 'red', 'Color' => '#E51016', ], [ 'Title' => 'Blue', 'CSSClass' => 'blue', 'Color' => '#1F6BFE', ], [ 'Title' => 'Green', 'CSSClass' => 'green', 'Color' => '#298436', ] ] ) ] ); return $fields; }
Versioning
This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.
All methods, with public
visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep protected
methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.