Skip to content

Commit

Permalink
feat: add wrapper styles
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Jan 13, 2021
1 parent e069eb0 commit f1934b8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 30 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ export class EditorComponent implements OnInit, OnDestroy {
Then in HTML

```html
<ngx-editor-menu [editor]="editor" [toolbar]="toolbar"> </ngx-editor-menu>
<ngx-editor
[editor]="editor"
[ngModel]="html"
[editable]="true"
[placeholder]="Type here..."
></ngx-editor>
<div class="NgxEditor__Wrapper">
<ngx-editor-menu [editor]="editor" [toolbar]="toolbar"> </ngx-editor-menu>
<ngx-editor
[editor]="editor"
[ngModel]="html"
[editable]="true"
[placeholder]="Type here..."
></ngx-editor>
</div>
```

Note: Input can be a HTML string or a jsonDoc
Expand Down
2 changes: 1 addition & 1 deletion demo/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<form [formGroup]="form">

<div class="editor">
<div class="editor NgxEditor__Wrapper">
<ngx-editor-menu [editor]="editor" [toolbar]="toolbar" [customMenuRef]="customMenu">
</ngx-editor-menu>
<ngx-editor [editor]="editor" formControlName="editorContent">
Expand Down
15 changes: 0 additions & 15 deletions demo/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@
}

.editor {
border: 2px solid rgba(0, 0, 0, 0.2);
border-radius: 4px;

.NgxEditor__MenuBar {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.NgxEditor {
border-top-left-radius: 0;
border-top-right-radius: 0;
border: none;
}

.CodeMirror {
border: 1px solid #eee;
height: auto;
Expand Down
16 changes: 9 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ export class EditorComponent implements OnInit, OnDestroy {
Then in HTML

```html
<ngx-editor-menu [editor]="editor" [toolbar]="toolbar"> </ngx-editor-menu>
<ngx-editor
[editor]="editor"
[ngModel]="html"
[editable]="true"
[placeholder]="Type here..."
></ngx-editor>
<div class="NgxEditor__Wrapper">
<ngx-editor-menu [editor]="editor" [toolbar]="toolbar"> </ngx-editor-menu>
<ngx-editor
[editor]="editor"
[ngModel]="html"
[editable]="true"
[placeholder]="Type here..."
></ngx-editor>
</div>
```

Note: Input can be a HTML string or a jsonDoc
Expand Down
17 changes: 17 additions & 0 deletions src/lib/editor.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,20 @@ $light-gray: #f1f1f1;
}
}
}

.NgxEditor__Wrapper {
border: 1px solid rgba(0, 0, 0, 0.4);
border-radius: 4px;

.NgxEditor__MenuBar {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.NgxEditor {
border-top-left-radius: 0;
border-top-right-radius: 0;
border: none;
}
}

0 comments on commit f1934b8

Please sign in to comment.