raspberryswwwirl/silverstripe-md-colorfield

Proof-of-concept for Material Design colorpicker built with Vue.

Installs: 172

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Language:SCSS

Type:silverstripe-vendormodule

2.0.0 2023-11-11 06:07 UTC

This package is auto-updated.

Last update: 2024-04-11 07:02:58 UTC


README

While this is a proof-of-concept to illustrate how to implement color swatch generation/selection based on the Material Design color system, it's a thank you to the SilverStripe community--especially those in the SilverStripe Slack channels--for all of the help getting this concept to work.

(Tear this thing apart, maybe see what you can do to implement it in React, or send me feedback on how to improve this concept).

This implementation makes use of the TinyColor library to render color and calculate contrast ratios for text displayed on those colors. Vue provides the user interaction and state management to workaround some odd behaviour with SS FormField states.

By design, a color set is composed of a "Base Color" and "Color Variants"--the variants themselves are generated from the base color. While the base color should be persisted to its own db field, the variant colors must be persisted to a second db field. In the future, this is likely to be replaced with some sort of json serialization to a single field, but for this proof-of-concept, these values are persisted separately. This has some benefits in that the values can be pre-defined separately in your config.yml or theme.yml

Requirements

  • SilverStripe ^4.0

Installation

composer require raspberryswwwirl/silverstripe-md-colorfield:dev-develop

License

See License

We have included a 3-clause BSD license you can use as a default. We advocate for the BSD license as it is one of the most permissive and open licenses.

Documentation

Maintainers

Bugtracker

Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.

If the issue does look like a new bug:

  • Create a new issue
  • Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots and screencasts can help here.
  • Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, Operating System, any installed SilverStripe modules.

Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.

Development and contribution

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.