Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix displayed identical fonts in sign PDF (#2751)
# Description of Changes ### Changes: - Add a new custom select to display fonts correctly and to allow more styling flexibility in Sign PDF feature by hiding the original `<select>` element (`display: none;`) and wrap it with a `<div>` and then create a custom selection menu using `<div>`s and CSS to achieve the required results due to the limitations of `<select>` and `<option>` while still preserving the hidden `<select>` for form submission. ### Why was the change made? 1. A bug that caused font families to not be displayed in Firefox. 2. Select/Option element are not flexible when it comes to styling (compared to DIVs for example) but bullet point `1.` is of higher priority. ### UI Changes: - Dark Mode: - Before:  - After:  - Light Mode: - Before:  - After:  Note: - Changes in `sign.js` are between the lines 95-228, as it seems the file was auto-formatted affecting whitespaces and single_quotes/double_quotes. #### Useful quotes from MDN: > [Styling with CSS](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#styling_with_css) Styling the <option> element is highly limited. Options don't inherit the font set on the parent. In Firefox, only [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) and [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color) can be set, however in Chrome and Safari it's not possible to set any properties. You can find more details about styling in [our guide to advanced form styling](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Advanced_form_styling). #### Useful references: - [Option Element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#styling_with_css) - [Select Element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) - [Advanced Form Styling](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Advanced_form_styling) Closes #1575 --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [x] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [x] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details.
- Loading branch information