-
Notifications
You must be signed in to change notification settings - Fork 108
Feat/ Adjustable font size to code editor #246
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
base: core
Are you sure you want to change the base?
Conversation
… moved font-size to the end of settings list since editor preview is rendering it in real time
Download and install |
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.
just one small change request 🙏
src/php/settings/settings-fields.php
Outdated
@@ -215,6 +216,14 @@ function get_settings_fields(): array { | |||
'options' => get_editor_theme_list(), | |||
'codemirror' => 'theme', | |||
], | |||
'font_size' => [ | |||
'name' => __( 'Code Editor Font Size', 'code-snippets' ), |
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.
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.
Ok, done. Rebuilt with that change.
In my initial approach, I placed it there, but the user wouldn’t see the changes in the editor preview, since it’s not within the same viewport. That’s why I felt it made more sense to place it closer to the editor, allowing users to make fine adjustments to the font size and immediately see the effect.
Perhaps the three fields that allow fine-tuning (rather than just toggling a setting) would be better positioned near the editor for a more intuitive user experience.
Download and install |
This pull request introduces the Adjustable Font Size feature for the Code Editor.
It adds a new option within the Editor Settings panel, allowing users to set a custom font size. The selected value is applied via inline CSS to the .CodeMirror class.
When the user updates the font size in the settings panel, the code preview dynamically reflects the change without requiring a page reload.