mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
Merge pull request #6238 from ivanov/cm-heading-fonts
proportional font-size when editing heading cells
This commit is contained in:
commit
c15284d716
@ -351,6 +351,9 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
HeadingCell.options_default = {
|
HeadingCell.options_default = {
|
||||||
|
cm_config: {
|
||||||
|
theme: 'heading-1'
|
||||||
|
},
|
||||||
placeholder: "Type Heading Here"
|
placeholder: "Type Heading Here"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -362,6 +365,7 @@ define([
|
|||||||
this.level = data.level;
|
this.level = data.level;
|
||||||
}
|
}
|
||||||
TextCell.prototype.fromJSON.apply(this, arguments);
|
TextCell.prototype.fromJSON.apply(this, arguments);
|
||||||
|
this.code_mirror.setOption("theme", "heading-"+this.level);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -378,6 +382,8 @@ define([
|
|||||||
*/
|
*/
|
||||||
HeadingCell.prototype.set_level = function (level) {
|
HeadingCell.prototype.set_level = function (level) {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
|
this.code_mirror.setOption("theme", "heading-"+level);
|
||||||
|
|
||||||
if (this.rendered) {
|
if (this.rendered) {
|
||||||
this.rendered = false;
|
this.rendered = false;
|
||||||
this.render();
|
this.render();
|
||||||
|
@ -35,3 +35,26 @@ h1,h2,h3,h4,h5,h6 {
|
|||||||
div.cell.text_cell.rendered {
|
div.cell.text_cell.rendered {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cm-s-heading-1,
|
||||||
|
.cm-s-heading-2,
|
||||||
|
.cm-s-heading-3,
|
||||||
|
.cm-s-heading-4,
|
||||||
|
.cm-s-heading-5,
|
||||||
|
.cm-s-heading-6 {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: @font-family-sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-heading-1 { font-size:150%; }
|
||||||
|
.cm-s-heading-2 { font-size: 130%; }
|
||||||
|
.cm-s-heading-3 { font-size: 120%; }
|
||||||
|
.cm-s-heading-4 { font-size: 110%; }
|
||||||
|
.cm-s-heading-5 {
|
||||||
|
font-size: 100%;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
.cm-s-heading-6 {
|
||||||
|
font-size: 90%;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
29
IPython/html/static/style/ipython.min.css
vendored
29
IPython/html/static/style/ipython.min.css
vendored
@ -1130,6 +1130,35 @@ h6:hover .anchor-link {
|
|||||||
div.cell.text_cell.rendered {
|
div.cell.text_cell.rendered {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
.cm-s-heading-1,
|
||||||
|
.cm-s-heading-2,
|
||||||
|
.cm-s-heading-3,
|
||||||
|
.cm-s-heading-4,
|
||||||
|
.cm-s-heading-5,
|
||||||
|
.cm-s-heading-6 {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
}
|
||||||
|
.cm-s-heading-1 {
|
||||||
|
font-size: 150%;
|
||||||
|
}
|
||||||
|
.cm-s-heading-2 {
|
||||||
|
font-size: 130%;
|
||||||
|
}
|
||||||
|
.cm-s-heading-3 {
|
||||||
|
font-size: 120%;
|
||||||
|
}
|
||||||
|
.cm-s-heading-4 {
|
||||||
|
font-size: 110%;
|
||||||
|
}
|
||||||
|
.cm-s-heading-5 {
|
||||||
|
font-size: 100%;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
.cm-s-heading-6 {
|
||||||
|
font-size: 90%;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
.widget-area {
|
.widget-area {
|
||||||
/*
|
/*
|
||||||
LESS file that styles IPython notebook widgets and the area they sit in.
|
LESS file that styles IPython notebook widgets and the area they sit in.
|
||||||
|
29
IPython/html/static/style/style.min.css
vendored
29
IPython/html/static/style/style.min.css
vendored
@ -8867,6 +8867,35 @@ h6:hover .anchor-link {
|
|||||||
div.cell.text_cell.rendered {
|
div.cell.text_cell.rendered {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
.cm-s-heading-1,
|
||||||
|
.cm-s-heading-2,
|
||||||
|
.cm-s-heading-3,
|
||||||
|
.cm-s-heading-4,
|
||||||
|
.cm-s-heading-5,
|
||||||
|
.cm-s-heading-6 {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
}
|
||||||
|
.cm-s-heading-1 {
|
||||||
|
font-size: 150%;
|
||||||
|
}
|
||||||
|
.cm-s-heading-2 {
|
||||||
|
font-size: 130%;
|
||||||
|
}
|
||||||
|
.cm-s-heading-3 {
|
||||||
|
font-size: 120%;
|
||||||
|
}
|
||||||
|
.cm-s-heading-4 {
|
||||||
|
font-size: 110%;
|
||||||
|
}
|
||||||
|
.cm-s-heading-5 {
|
||||||
|
font-size: 100%;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
.cm-s-heading-6 {
|
||||||
|
font-size: 90%;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
.widget-area {
|
.widget-area {
|
||||||
/*
|
/*
|
||||||
LESS file that styles IPython notebook widgets and the area they sit in.
|
LESS file that styles IPython notebook widgets and the area they sit in.
|
||||||
|
Loading…
Reference in New Issue
Block a user