Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style the framed editor #3596

Merged
merged 4 commits into from
Dec 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/modules/editor/engines/framed.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ function FramedEngine(options) {
this.iframeDoc.close();
// Style the iframe
this.iframeNode.className = this.dummyTextArea.className;
this.iframeNode.style["border-radius"] = "2px";
this.iframeNode.style.border = "none";
this.iframeNode.style.padding = "0";
this.iframeNode.style.resize = "none";
this.iframeNode.style["background-color"] = this.widget.wiki.extractTiddlerDataItem(this.widget.wiki.getTiddlerText("$:/palette"),"background");
this.iframeDoc.body.style.margin = "0";
this.iframeDoc.body.style.padding = "0";
this.widget.domNodes.push(this.iframeNode);
Expand Down Expand Up @@ -92,6 +94,12 @@ FramedEngine.prototype.copyStyles = function() {
this.domNode.style.display = "block";
this.domNode.style.width = "100%";
this.domNode.style.margin = "0";
this.domNode.style.resize = "none";
this.domNode.style.border = "none";
this.domNode.style["border-radius"] = "2px";
this.domNode.style["padding-left"] = "0.5em";
this.domNode.style["padding-top"] = "0.3em";
this.domNode.style["background-color"] = this.widget.wiki.extractTiddlerDataItem(this.widget.wiki.getTiddlerText("$:/palette"),"background");
// In Chrome setting -webkit-text-fill-color overrides the placeholder text colour
this.domNode.style["-webkit-text-fill-color"] = "currentcolor";
};
Expand Down
4 changes: 4 additions & 0 deletions themes/tiddlywiki/snowwhite/base.tid
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ textarea.tc-edit-texteditor {
font-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}};
}

.tc-tiddler-frame.tc-tiddler-edit-frame iframe.tc-edit-texteditor {
<<box-shadow "1px 1px 5px rgba(0, 0, 0, 0.3)">>
}

canvas.tc-edit-bitmapeditor {
<<box-shadow "2px 2px 5px rgba(0, 0, 0, 0.5)">>
}
Expand Down
5 changes: 5 additions & 0 deletions themes/tiddlywiki/vanilla/base.tid
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,11 @@ button.tc-untagged-label {
font-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}};
}

.tc-tiddler-frame.tc-tiddler-edit-frame iframe.tc-edit-texteditor {
border-radius: 2px;
background-color: <<colour tiddler-background>>;
}

.tc-tiddler-frame .tc-binary-warning {
width: 100%;
height: 5em;
Expand Down