Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge dfc014b into f5849d5
Browse files Browse the repository at this point in the history
  • Loading branch information
dkonopka authored Sep 30, 2019
2 parents f5849d5 + dfc014b commit 90fd413
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/pagebreakediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,17 @@ export default class PageBreakEditing extends Plugin {
view: ( modelElement, viewWriter ) => {
const label = t( 'Page break' );
const viewWrapper = viewWriter.createContainerElement( 'div' );
const viewLabelElement = viewWriter.createContainerElement( 'span' );
const innerText = viewWriter.createText( t( 'Page break' ) );

viewWriter.addClass( 'ck-page-break', viewWrapper );
viewWriter.setCustomProperty( 'pageBreak', true, viewWrapper );

viewWriter.addClass( 'ck-page-break_label', viewLabelElement );

viewWriter.insert( viewWriter.createPositionAt( viewWrapper, 0 ), viewLabelElement );
viewWriter.insert( viewWriter.createPositionAt( viewLabelElement, 0 ), innerText );

return toPageBreakWidget( viewWrapper, viewWriter, label );
}
} );
Expand Down
31 changes: 27 additions & 4 deletions theme/pagebreak.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,32 @@
*/

.ck .ck-page-break {
position: relative;
clear: both;
padding: 5px;
border: 2px dashed var(--ck-color-toolbar-border);
border-left: 0;
border-right: 0;
padding: 5px 0;
display: flex;
justify-content: center;
}

.ck .ck-page-break::after {
content: '';
position: absolute;
border-bottom: 2px dashed var(--ck-color-toolbar-border);
width: 100%;
top: 50%;
transform: translateY( -50% );
}

.ck .ck-page-break_label {
position: relative;
z-index: var(--ck-z-default);
padding: var(--ck-spacing-tiny) var(--ck-spacing-standard);
display: block;
text-transform: uppercase;
border: 1px solid var(--ck-color-toolbar-border);
border-radius: var(--ck-border-radius);
font-size: var(--ck-font-size-small);
font-weight: bold;
color: var(--ck-color-toolbar-border);
background: var(--ck-color-base-background);
}

0 comments on commit 90fd413

Please sign in to comment.