Closed charlieJ107 closed 3 months ago
@charlieJ107 Hi, is this ready for review?
@charlieJ107 Hi, is this ready for review?
Not yet. I'm working on the preference page UI, but some things from somewhere else are delaying things. Thanks for being patient, and I'll notify you here as soon as it's ready for review.
@GeoffreyChen777 Hi, since currently the CSS syntax is optional and could be a complex feature that is not a responsibility of paper management tool, I think this PR is ready for review at the moment.
I do intend to add a warning on the UI indicate that adding custom CSS could be dangerous and may crash the programme and only users familiar with related technology should touch this feature.
CSS would not crash the app, I think it's unnecessary to validate CSS syntax.
My suggestion is that:
windowManagementService
:
insertCustomCSS(windowId: string, css: string)
: we just enforce that one window only has one custom css. So first delete the old custom css with the corresponding key. Then insert the new css. and store the key as a private member.removeCustomCSS(windowId)
: delete the custom css with the given window id.PLMainAPI.windowManagementService.insertCustomCSS
to insert (overwrite) css.That would be a much easier solution.
Fix #273
This PR provides a field for custom CSS styles in the preference settings page and sets the provided CSS value when every window renders.
Validate CSS syntax