Ckeditor5-angular: How to set content default height or min-height

Created on 19 Sep 2018  路  11Comments  路  Source: ckeditor/ckeditor5-angular

I had created Ckeditor textarea but its height is always one line height.
It is possible to set default height?

The result is following
image

docs question

Most helpful comment

I'm sorry for the latest answer, Didn't want to be rude.

In fact, there're two ways to style the component.

First is via the global stylesheet and then this should work:

.ck-editor__editable {
    min-height: 500px !important;
}

But if you want to have the style in the parent component, then you need to add :host ::ng-deep pseudo selectors before.

:host ::ng-deep .ck-editor__editable {
    min-height: 500px !important;
}

All 11 comments

It's answered here: https://stackoverflow.com/questions/46559354/how-to-set-the-height-of-ckeditor-5-classic-editor.

Please, make some research before reporting issues in the future :)

I've came across that question, it's not working by adding that css rule to the css file of the component that hosts the editor, Noting that it works when I add the rule n the browser console

I'm sorry for the latest answer, Didn't want to be rude.

In fact, there're two ways to style the component.

First is via the global stylesheet and then this should work:

.ck-editor__editable {
    min-height: 500px !important;
}

But if you want to have the style in the parent component, then you need to add :host ::ng-deep pseudo selectors before.

:host ::ng-deep .ck-editor__editable {
    min-height: 500px !important;
}

In fact, we should mention this in docs, as styling the angular component can be misleasing.

Very nice change! Thanks.

The table cells of inserted table also has class .ck-editor__editable, using the solution in the above comments may cause your tables looks weird.

Hi @phoenixgao.

This issue is already outdated. See the latest docs: https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/angular.html#styling.

would be nice if we can specify the number of rows as we do for