logo polydile dile-components

dile-editor

Webcomponent to implement a rich markdown editor.

This component is a "work in progress".

Installation

npm i @dile/dile-editor

Usage

Import the component:

import '@dile/dile-editor/dile-editor.js';

Use the component:

<dile-editor></dile-editor>

Properties

Events

CSS Custom Properties

You can customize the editor using this CSS Custom Properties.

Custom propertyDescriptionDefault
--dile-input-section-widthEditor width100%
--dile-editor-focus-border-colorColor border on focused state36px
--dile-input-label-font-sizeFont size for the label1em
--dile-input-label-colorColor for the label text#59e
--dile-input-label-font-weightLabel text font weightnormal
--dile-input-label-margin-bottomLabel marging bottom4px
--dile-editor-background-colorEditor background color#fff;
--dile-editor-views-nav-background-colorEditor views selector background color#f5f5f5
--dile-editor-views-nav-colorEditor views selector text color#106eda
--dile-editor-views-nav-selected-colorEditor views selected view text color#0f4e96
--dile-editor-views-nav-selected-line-colorEditor views selected view line color#0f4e96
--dile-editor-toolbar-background-colorToolbar background colortransparent
--dile-editor-toolbar-colorToolbar icons color#303030
--dile-icon-sizeToolbar icons size24px
--dile-input-message-padding-topSpace from input to message4px
--dile-input-message-font-sizeMessage font size0.875rem
--dile-input-message-colorMessage text color#888
--dile-input-message-error-colorMessage text color on errored state#c00

You can use the dile-select component custom properties to change the paragraph type styles.

dile-editor demos

Empty editor

<dile-editor></dile-editor>