Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://amka.github.io/quill-focus/

Enable focus mode
https://amka.github.io/quill-focus/

Last synced: about 1 month ago
JSON representation

Enable focus mode

Awesome Lists containing this project

README

        

# Quill Focus

This package is a [Quill.js](https://quillljs.com/) module that add focus mode.

## Quickstart

### NPM Mode

Just install it as usual with npm:

```bash
> npm i quill-focus
```

And then import it in your code, something like this:

```html

// Quill first!
var Quill = require('quill');
// Quill-Focus next
var Focus = require('quill-focus');
Quill.register('modules/focus', Focus)
var quill = new Quill('#editor', {
theme: 'snow',
modules: {
focus: {
focusClass: 'focused-blot' // Defaults to .focused-blot.
}
}
});

```

Done!

### Normal HTML

To install the module, set up an instance of Quill, add a script tag to the focus.js file and register it as a Quill module.
Don't forget to link default focus stylesheet. See example.

```html




Quill-Focus Example







// Don't forget to register module
Quill.register('modules/focus', Focus)

var quill = new Quill('#editor', {
theme: 'snow',
modules: {
// Activate Focus module
focus: {
focusClass: 'focused-blot' // Defaults to .focused-blot.
}
}
});

```

---
Thanks!