Added feature in Preferences to allow user to chose the font of the page#1962
Open
jtnguyen45 wants to merge 3 commits intofreeCodeCamp:mainfrom
Open
Added feature in Preferences to allow user to chose the font of the page#1962jtnguyen45 wants to merge 3 commits intofreeCodeCamp:mainfrom
jtnguyen45 wants to merge 3 commits intofreeCodeCamp:mainfrom
Conversation
simon04
requested changes
Apr 12, 2023
Contributor
simon04
left a comment
There was a problem hiding this comment.
Thanks to working on this feature. I've left a few suggestions/questions.
| @updateColorMeta() | ||
| return | ||
|
|
||
| setFont: (font) -> |
Contributor
There was a problem hiding this comment.
I think you're missing a @setFont(@get('font')) in line 141?
Comment on lines
+27
to
+31
| <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> |
Contributor
There was a problem hiding this comment.
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)?
| font-size: 1em; | ||
| font-weight: normal; | ||
| font-family: $baseFont; | ||
| font-family: var(--selectedFont, $baseFont); |
Contributor
There was a problem hiding this comment.
In _variables.scss, we already define the variables --baseFont and --monoFont – I think we should re-use them instead of introducing another one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created a drop down of font options that allows the user to chose the type of font used for the app, within the Preferences page. The font changes the entire page automatically when user clicks on a font option. I chose 5 fonts randomly (Arial, Cascadia, Fira Code, Proxima Nova, Verdana) but can change them to different fonts easily if desired.