Skip to content
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

How to enable dark mode for angular app? #72

Open
lucasrodrigues10 opened this issue Mar 25, 2024 · 1 comment
Open

How to enable dark mode for angular app? #72

lucasrodrigues10 opened this issue Mar 25, 2024 · 1 comment
Labels
question Further information is requested

Comments

@lucasrodrigues10
Copy link

I installed pretty-print-json package using NPM and added the this typescript and html code in my angular component:

const elem = document.getElementById("account");

if (!elem) {
  return;
}

const data = { active: true, mode: "🚃", codes: [48348, 28923, 39080], city: "London" };
elem.innerHTML = prettyPrintJson.toHtml(data, { quoteKeys: true });
<pre id="account" class="json-container dark-mode"></pre>

However I could not manage to make it work with dark mode.
The others configs are working as expected so far.

Can you guys help me, please? I think I'm missing a step.

@dpilafian
Copy link
Member

Adding the class dark-mode to the container as you have done should be sufficient assuming the default CSS is loaded into the web page.

Is the pretty-print-json.css file correctly linked:
https://github.com/center-key/pretty-print-json/blob/main/dist/css/pretty-print-json.css

@dpilafian dpilafian added the question Further information is requested label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants