EvotecIT / PSWriteHTML

PSWriteHTML is PowerShell Module to generate beautiful HTML reports, pages, emails without any knowledge of HTML, CSS or JavaScript. To get started basics PowerShell knowledge is required.
MIT License
819 stars 105 forks source link

Dark mode support #89

Open PrzemyslawKlys opened 4 years ago

PrzemyslawKlys commented 4 years ago

Some possible solutions:

  1. I would like to have automatic dark mode switch available
  2. I would like to have manual switch available

This looks easy, but there's a lot of things to make sure things run as required. Tables/Diagrams/etc.

Not easy, unless I miss something obvious.

travishamera-hka commented 4 months ago

I'd be interested in seeing this. what about creating a new type of child element for navigation that would be for create a new nav menu root and items (that would typically be aligned to the right?). That new type of nav would have these special nodes that are parameterized to pass a css class to be applied to the body tag, a "name", and maybe even an icon. These could be under functions titled something like "nav theme nodes". The main nav link for this theme system would require providing the path to a css file that has all the styles associated with these themes (or maybe each node has its own?) Each nav link when clicked would apply the css styles from the provided files to the end of the body to embed those styles (and being at the end, they would override most styles). The nodes are essentially just using jQuery to swap which theme class is applied to the body which essentially give you a theming system. Would love to provide a pull request for this myself but currently buried in a report development and tight schedules. Would love to see this though!

PrzemyslawKlys commented 4 months ago

So in most cases it will be <body data-bs-theme="light"> which is supported by many libraries, few of them it's just matter of fixing background, but it requires testing and slowly adding things. For others it will require some more work. I am currently busy with my other projects so this isn't a priority for me. Unless someone makes a PR starter I don't think I will pick it up.