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

Background is forced to white|black #16

Open
nelson6e65 opened this issue Oct 2, 2022 · 4 comments
Open

Background is forced to white|black #16

nelson6e65 opened this issue Oct 2, 2022 · 4 comments

Comments

@nelson6e65
Copy link

nelson6e65 commented Oct 2, 2022

Background (--color-canvas-default) is forced to black and white.

To use on editors, like Visual Studio Code, not all themes are black|white.

I know I can publish my own style, but it would be nice to have an extra CSS file published with transparent background in the official CDN. Like:

/* github-markdown-with-transparent-background.css */

:root {
  --color-canvas-default: #00000000;
}

.markdown-body {
  background-color: var(--color-canvas-default);
}

@media (prefers-color-scheme: dark) {
  .markdown-body {
    --color-canvas-default: #00000000;
  }
}

@media (prefers-color-scheme: light) {
  .markdown-body {
    --color-canvas-default: #ffffff00;
  }
}

So we can import it at the end, like:

imagen

@nelson6e65
Copy link
Author

nelson6e65 commented Jan 8, 2023

nelson6e65 referenced this issue in elegantech/github-markdown-css Jan 8, 2023
Extra CSS to set background color to transparent instead of forced white/black.
@jd-solanki
Copy link

I'm also facing the same in VSCode.

@nelson6e65 I'm using your CSS, in case if you are removing it assuming no one is using it.

  "markdown.styles": [
    "https://cdn.jsdelivr.net/gh/sindresorhus/github-markdown-css/github-markdown.css",
    "https://cdn.jsdelivr.net/gh/elegantech/github-markdown-css@transparent/github-markdown-with-transparent-background.min.css"
  ],

@nelson6e65
Copy link
Author

nelson6e65 commented Feb 7, 2023

I'm using it, too, @jd-solanki. 🤭

But in my case, I'm using github-markdown-dark.min.css, because github-markdown.css only work if you have auto color schema in your editor theme enabled and your SO.

It is available in my transparent branch (elegantech/github-markdown-css@bfa0f5d#commitcomment-95419774), but I just added manually, I don't know how to apply it as PR into this repository.

@hyrious
Copy link
Collaborator

hyrious commented Feb 7, 2023

If it were about to add to this repo, then it must be an option that alters the generating logic, like --background=transparent.

Note that it may not fully solve your original problem. As I know about VSCode, it has defined its own colors about blockquotes and other corners. In the end you will still have to write additional styles to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants