-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Added feature in Preferences to allow user to chose the font of the page #1962
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ themeOption = ({ label, value }, settings) -> """ | |
|
||
app.templates.settingsPage = (settings) -> """ | ||
<h1 class="_lined-heading">Preferences</h1> | ||
|
||
<div class="_settings-fieldset"> | ||
<h2 class="_settings-legend">Theme:</h2> | ||
<div class="_settings-inputs"> | ||
|
@@ -20,6 +19,21 @@ app.templates.settingsPage = (settings) -> """ | |
</div> | ||
</div> | ||
|
||
<div class="_settings-fieldset"> | ||
<h2 class="_settings-legend">Font:</h2> | ||
<div class="_settings-inputs"> | ||
<label class="_settings-label _setting-font-family"> | ||
<select name="font" id="_setting-font-family"> | ||
<option value="arial" #{if (settings.font == 'Arial' or not settings.font) then ' selected' else ''}>Arial (default)</option> | ||
<option value="cascadia" #{if settings.font == 'Cascadia' then ' selected' else ''}>Cascadia</option> | ||
<option value="fira-code" #{if settings.font == 'Fira Code' then ' selected' else ''}>Fira Code</option> | ||
<option value="proxima-nova" #{if settings.font == 'Proxima Nova' then ' selected' else ''}>Proxima Nova</option> | ||
<option value="verdana" #{if settings.font == 'Verdana' then ' selected' else ''}>Verdana</option> | ||
Comment on lines
+27
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get the selection of the fonts. Some seem to be targetting the user interface (such as Arial). Some seem to be targetting the code blocks (such as Fira Code)? |
||
</select> | ||
</label> | ||
</div> | ||
</div> | ||
|
||
<div class="_settings-fieldset"> | ||
<h2 class="_settings-legend">General:</h2> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,17 @@ html._theme-dark { | |
color-scheme: dark only; | ||
} | ||
|
||
:root { | ||
--selectedFont: Arial; | ||
} | ||
|
||
body { | ||
height: 100%; | ||
margin: 0; | ||
overflow: auto; | ||
font-size: 1em; | ||
font-weight: normal; | ||
font-family: $baseFont; | ||
font-family: var(--selectedFont, $baseFont); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In _variables.scss, we already define the variables |
||
line-height: 1.7; | ||
color: $textColor; // fallback to show the error message to browsers that don't support CSS variables. | ||
color: var(--textColor); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing a
@setFont(@get('font'))
in line 141?