add font variables for headings, headings input for font chooser and fix quote variable (#322)

* add font variables for headings, headings input for font chooser and fix quote variable

* fix spaces for consistent code

* fix version number (semver)

* bring together all heading styles

* bring together all heading variables

* update font styling loop
This commit is contained in:
Emir 2020-12-06 04:54:25 +03:00 committed by GitHub
parent 4eb63f751f
commit ca605ec049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 4 deletions

View File

@ -149,6 +149,9 @@
.notion-selectable.notion-quote-block div[spellcheck="true"] {
font-family: var(--theme--font_quote) !important;
}
[placeholder='Heading 1'], [placeholder='Heading 2'], [placeholder='Heading 3'] {
font-family: var(--theme--font_headings) !important;
}
.notion-frame .notion-page-block div[placeholder='Untitled'],
.notion-overlay-container .notion-page-block div[placeholder='Untitled'] {
font-size: calc(

View File

@ -37,6 +37,7 @@
--theme_dark--font_code: SFMono-Regular, Consolas, 'Liberation Mono', Menlo,
Courier, monospace;
--theme_dark--font_quote: var(--theme_dark--font_sans);
--theme_dark--font_headings: var(--theme_dark--font_sans);
--theme_dark--font_title-size: 40px;
--theme_dark--font_heading1-size: 1.875em;
@ -222,6 +223,7 @@
--theme_light--font_code: SFMono-Regular, Consolas, 'Liberation Mono', Menlo,
Courier, monospace;
--theme_light--font_quote: var(--theme_light--font_sans);
--theme_light--font_headings: var(--theme_light--font_sans);
--theme_light--font_title-size: 40px;
--theme_light--font_heading1-size: 1.875em;
@ -399,7 +401,8 @@
--theme--font_serif: var(--theme_dark--font_serif);
--theme--font_mono: var(--theme_dark--font_mono);
--theme--font_code: var(--theme_dark--font_code);
--theme--font_quote: var(--theme_dark--font_sans);
--theme--font_quote: var(--theme_dark--font_quote);
--theme--font_headings: var(--theme_dark--font_headings);
--theme--font_title-size: var(--theme_dark--font_title-size);
--theme--font_heading1-size: var(--theme_dark--font_heading1-size);
--theme--font_heading2-size: var(--theme_dark--font_heading2-size);
@ -566,7 +569,8 @@
--theme--font_serif: var(--theme_light--font_serif);
--theme--font_mono: var(--theme_light--font_mono);
--theme--font_code: var(--theme_light--font_code);
--theme--font_quote: var(--theme_light--font_sans);
--theme--font_quote: var(--theme_light--font_quote);
--theme--font_headings: var(--theme_light--font_headings);
--theme--font_title-size: var(--theme_light--font_title-size);
--theme--font_heading1-size: var(--theme_light--font_heading1-size);
--theme--font_heading2-size: var(--theme_light--font_heading2-size);

View File

@ -14,7 +14,7 @@ module.exports = {
name: 'font chooser',
desc:
'customize fonts. for each option, type in the name of the font you would like to use, or leave it blank to not change anything.<br/><br/>make sure the fonts you type are installed on your device.',
version: '0.2.1',
version: '0.3.0',
author: 'torchatlas',
options: [
{
@ -47,6 +47,12 @@ module.exports = {
type: 'input',
value: '',
},
{
key: 'headings',
label: 'headings:',
type: 'input',
value: '',
},
],
hacks: {
'renderer/preload.js'(store, __exports) {
@ -54,8 +60,9 @@ module.exports = {
async function enhance() {
if (!document.querySelector('.notion-app-inner')) return;
clearInterval(attempt_interval);
for (let style of ['sans', 'serif', 'mono', 'code', 'quote']) {
for (let style of ['sans', 'serif', 'mono', 'code', 'quote', 'headings']) {
if (!store()[style]) continue;
document
.querySelector('.notion-app-inner')
.style.setProperty(`--theme--font_${style}`, store()[style]);