Skip to content

Commit 4bae2a9

Browse files
BurningTreeCjho1965us
BurningTreeC
authored andcommitted
Style the framed editor (TiddlyWiki#3596)
* style the framed editor this makes the framed editor look a bit less ugly 😎 * Update framed.js * Update base.tid * Update base.tid
1 parent 3f0ba22 commit 4bae2a9

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

core/modules/editor/engines/framed.js

+8
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ function FramedEngine(options) {
3939
this.iframeDoc.close();
4040
// Style the iframe
4141
this.iframeNode.className = this.dummyTextArea.className;
42+
this.iframeNode.style["border-radius"] = "2px";
4243
this.iframeNode.style.border = "none";
4344
this.iframeNode.style.padding = "0";
4445
this.iframeNode.style.resize = "none";
46+
this.iframeNode.style["background-color"] = this.widget.wiki.extractTiddlerDataItem(this.widget.wiki.getTiddlerText("$:/palette"),"background");
4547
this.iframeDoc.body.style.margin = "0";
4648
this.iframeDoc.body.style.padding = "0";
4749
this.widget.domNodes.push(this.iframeNode);
@@ -92,6 +94,12 @@ FramedEngine.prototype.copyStyles = function() {
9294
this.domNode.style.display = "block";
9395
this.domNode.style.width = "100%";
9496
this.domNode.style.margin = "0";
97+
this.domNode.style.resize = "none";
98+
this.domNode.style.border = "none";
99+
this.domNode.style["border-radius"] = "2px";
100+
this.domNode.style["padding-left"] = "0.5em";
101+
this.domNode.style["padding-top"] = "0.3em";
102+
this.domNode.style["background-color"] = this.widget.wiki.extractTiddlerDataItem(this.widget.wiki.getTiddlerText("$:/palette"),"background");
95103
// In Chrome setting -webkit-text-fill-color overrides the placeholder text colour
96104
this.domNode.style["-webkit-text-fill-color"] = "currentcolor";
97105
};

themes/tiddlywiki/snowwhite/base.tid

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ textarea.tc-edit-texteditor {
5050
font-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}};
5151
}
5252

53+
.tc-tiddler-frame.tc-tiddler-edit-frame iframe.tc-edit-texteditor {
54+
<<box-shadow "1px 1px 5px rgba(0, 0, 0, 0.3)">>
55+
}
56+
5357
canvas.tc-edit-bitmapeditor {
5458
<<box-shadow "2px 2px 5px rgba(0, 0, 0, 0.5)">>
5559
}

themes/tiddlywiki/vanilla/base.tid

+5
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,11 @@ button.tc-btn-invisible.tc-remove-tag-button {
10271027
font-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}};
10281028
}
10291029

1030+
.tc-tiddler-frame.tc-tiddler-edit-frame iframe.tc-edit-texteditor {
1031+
border-radius: 2px;
1032+
background-color: <<colour tiddler-background>>;
1033+
}
1034+
10301035
.tc-tiddler-frame .tc-binary-warning {
10311036
width: 100%;
10321037
height: 5em;

0 commit comments

Comments
 (0)