Skip to content

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

Open
wants to merge 8 commits into
base: core
Choose a base branch
from

Conversation

CarolinaOP
Copy link

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.

@CarolinaOP CarolinaOP requested review from sheabunge and imantsk August 4, 2025 13:51
@CarolinaOP CarolinaOP self-assigned this Aug 4, 2025
@CarolinaOP CarolinaOP added build Adding this label will trigger the zip build action and removed build Adding this label will trigger the zip build action labels Aug 4, 2025
Copy link

github-actions bot commented Aug 5, 2025

Download and install

📦 code-snippets.zip

Copy link
Member

@imantsk imantsk left a 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 🙏

@@ -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' ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rename this setting to just Font Size and move it right before Wrap Lines

Image

Copy link
Author

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.

@CarolinaOP CarolinaOP added build Adding this label will trigger the zip build action and removed build Adding this label will trigger the zip build action labels Aug 5, 2025
Copy link

github-actions bot commented Aug 5, 2025

Download and install

📦 code-snippets.zip

@CarolinaOP CarolinaOP requested a review from imantsk August 6, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Adding this label will trigger the zip build action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants