Ingmar
Ingmar

Reputation: 1457

How to set the initial font size?

I'm using Quill 2.0.2, it's very easy to setup a basic editor, but how can I set the initial font size? I found similar posts from 2016 on the web, but this seems to refer to an older version.

Does anybody know on how to complete the following script with the initial font size? Or alternatively: How can I select everything inside the editor and then assign a font size?

<script>
    const quill = new Quill('#editor', {
        theme: 'snow'
    });
</script>

Upvotes: 0

Views: 188

Answers (1)

Ingmar
Ingmar

Reputation: 1457

I found a very easy solution with jQuery that works perfectly in my scenario:

<script>
    const quill = new Quill('#editor', {
        theme: 'snow'
    });

    // Set font size via css
    $('#editor').find('.ql-editor').css('font-size', 24);

</script>

Upvotes: 1

Related Questions