Skip to content

ld-x/ld-color-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ld-color-picker

color-picker plugin for last-draft

npm version

Install

npm install ld-color-picker --save

Use

import {Editor} from 'last-draft'
import color from 'ld-color-picker'
let plugins = [color]

export default class ExampleEditor extends Component {
  constructor(props) {
    super(props)
    const INITIAL_STATE = editorStateFromHtml('<div></div>')
    this.state = { value: INITIAL_STATE }
  }

  onChange(editorState) {
    this.setState({ value: editorState })
  }

  render() {
    return (
      <Editor
        inline={['bold', 'italic', 'code', 'dropcap']}
        blocks={['h2', 'quote']}
        plugins={plugins}
        editorState={this.state.value}
        onChange={::this.onChange} />
    )
  }
}

Styles

Last Draft plugins use styled-components 💅 for the base styling.

Custom Styles with CSS

You can also add custom css to override the base styling with the following class names specified below:

.ld-button-color-picker {}
.ld-color-picker-modal-wrapper {}
.ld-color-picker-wrapper {}
.ld-color-picker-close-wrapper {}
.ld-color-picker-close {}
.ld-color-picker {}
.ld-color-picker-item {}

About

Last Draft color picker plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published