header size setting added

This commit is contained in:
Christian Müller
2014-10-05 20:45:08 +02:00
parent 94a948d962
commit dccf9e3966
4 changed files with 28 additions and 8 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
- **API**: Integrate the publishing functionality into your editor using the official [NoteHub API](/api).
## Changelog
- **2014-09**: text size setting added ([example](/2014/3/31/demo-note?text-font=monospace&header-font=Courier&text-size=0.8))
- **2014-09**: text size setting added ([example](/2014/3/31/demo-note?text-font=monospace&header-font=Courier&text-size=0.7&header-size=1.1))
- **2014-07**: deprecated all API versions less than 1.4 & performance improvements.
- **2014-03**: note expiration implemented.
- **2014-02**: a simple JS-client for API testing [added](/api-test.html).
+2 -2
View File
@@ -25,9 +25,9 @@ and for the text itself:
notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2
Analogously, you can specify you can change the text size by specifying a scale factor:
Analogously, you can specify you can change the text or header size by specifying a scale factor:
notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2&text-size=1.5
notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2&text-size=1.1&header-size=1.2
See an example of the font formatting [here](http://www.notehub.org/8m4l9).
+2 -1
View File
@@ -98,7 +98,8 @@ if(ui["header-font"] || ui["text-font"]) {
}, "");
}
if(ui["text-size"]) vars["@font_size"] = ui["text-size"] + "em";
if(ui["text-size"]) vars["@text_size_factor"] = ui["text-size"];
if(ui["header-size"]) vars["@header_size_factor"] = ui["header-size"];
fontURL = fontURL.replace(/%s/, injection);
var fileref = document.createElement("link")
+23 -4
View File
@@ -13,7 +13,8 @@
@header_font: 'Noticia Text';
@text_font: 'Georgia';
@font_size: 1.2em;
@header_size_factor: 1;
@text_size_factor: 1;
// mixins
.helvetica {
@@ -110,6 +111,24 @@ h1, h2, h3, h4, h5, h6 {
font-weight: bold;
font-family: @header_font,'Noticia Text','PT Serif','Georgia';
}
h1 {
font-size: 1.8em * @header_size_factor;
}
h2 {
font-size: 1.6em * @header_size_factor;
}
h3 {
font-size: 1.4em * @header_size_factor;
}
h4 {
font-size: 1.2em * @header_size_factor;
}
h5 {
font-size: 1.1em * @header_size_factor;
}
h6 {
font-size: 1em * @header_size_factor;
}
#hero h1 {
font-size: 2.5em;
}
@@ -124,12 +143,12 @@ article {
text-align: justify;
}
article p {
font-size: @font_size;
font-size: 1.2em * @text_size_factor;
line-height: 140%;
}
article > h1:first-child {
text-align: center;
font-size: 2em;
font-size: 2em * @header_size_factor;
margin: 2em;
}
.centered {
@@ -141,7 +160,7 @@ article > h1:first-child {
code, pre {
font-family: monospace;
background: @background_halftone;
font-size: @font_size;
font-size: 1.2em * @text_size_factor;
}
pre {
border-radius: 3px;