-
Notifications
You must be signed in to change notification settings - Fork 37
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
Create custom styles #36
Comments
Can you elaborate on your request / question? |
I don't know if there is a way to overwrite the styles (CSS) of the library or how is it?
"This is all the documentation tells me." "I would only like to change the font and background" |
First of all, I think this is an uncommon usecase given most people will probably want markdown rendered in the GitHub style. If you insist on doing it anyways, here are some directions: Overwriting the CSSCSS just includes GitHub's default CSS. You can """overwrite""" it by just using normal css. By default the font is just set like this: .markdown-body {
font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
} you could probably change it like so (I don't think you need to specify !important but just to be safe): .markdown-body {
font-family: whatever-custom-font !important;
} You could do a similar thing to overwrite any of the colors you want by changing the css variables: :root,[data-color-mode=light][data-light-theme=light],[data-color-mode=dark][data-dark-theme=light]{
--color-canvas-default-transparent:rgba(255,255,255,0);
--color-prettylights-syntax-comment:#6e7781;
--color-prettylights-syntax-constant:#0550ae;
--color-prettylights-syntax-entity:#8250df;
--color-prettylights-syntax-storage-modifier-import:#24292f;
--color-prettylights-syntax-entity-tag:#116329;
--color-prettylights-syntax-keyword:#cf222e;
--color-prettylights-syntax-string:#0a3069;
--color-prettylights-syntax-variable:#953800;
--color-prettylights-syntax-string-regexp:#116329;
--color-prettylights-syntax-markup-deleted-text:#82071e;
--color-prettylights-syntax-markup-deleted-bg:#ffebe9;
--color-prettylights-syntax-markup-inserted-text:#116329;
--color-prettylights-syntax-markup-inserted-bg:#dafbe1;
--color-prettylights-syntax-constant-other-reference-link:#0a3069;
--color-fg-default:#24292f;
--color-fg-muted:#57606a;
--color-canvas-default:#fff;
--color-canvas-subtle:#f6f8fa;
--color-border-default:#d0d7de;
--color-border-muted:#d8dee4;
--color-neutral-muted:rgba(175,184,193,.2);
--color-accent-fg:#0969da;
--color-accent-emphasis:#0969da;
--color-danger-fg:#cf222e
}
@media (prefers-color-scheme:light){
[data-color-mode=auto][data-light-theme=light]{
--color-canvas-default-transparent:rgba(255,255,255,0);
--color-prettylights-syntax-comment:#6e7781;
--color-prettylights-syntax-constant:#0550ae;
--color-prettylights-syntax-entity:#8250df;
--color-prettylights-syntax-storage-modifier-import:#24292f;
--color-prettylights-syntax-entity-tag:#116329;
--color-prettylights-syntax-keyword:#cf222e;
--color-prettylights-syntax-string:#0a3069;
--color-prettylights-syntax-variable:#953800;
--color-prettylights-syntax-string-regexp:#116329;
--color-prettylights-syntax-markup-deleted-text:#82071e;
--color-prettylights-syntax-markup-deleted-bg:#ffebe9;
--color-prettylights-syntax-markup-inserted-text:#116329;
--color-prettylights-syntax-markup-inserted-bg:#dafbe1;
--color-prettylights-syntax-constant-other-reference-link:#0a3069;
--color-fg-default:#24292f;
--color-fg-muted:#57606a;
--color-canvas-default:#fff;
--color-canvas-subtle:#f6f8fa;
--color-border-default:#d0d7de;
--color-border-muted:#d8dee4;
--color-neutral-muted:rgba(175,184,193,.2);
--color-accent-fg:#0969da;
--color-accent-emphasis:#0969da;
--color-danger-fg:#cf222e
}
}
@media (prefers-color-scheme:dark){
[data-color-mode=auto][data-dark-theme=light]{
--color-canvas-default-transparent:rgba(255,255,255,0);
--color-prettylights-syntax-comment:#6e7781;
--color-prettylights-syntax-constant:#0550ae;
--color-prettylights-syntax-entity:#8250df;
--color-prettylights-syntax-storage-modifier-import:#24292f;
--color-prettylights-syntax-entity-tag:#116329;
--color-prettylights-syntax-keyword:#cf222e;
--color-prettylights-syntax-string:#0a3069;
--color-prettylights-syntax-variable:#953800;
--color-prettylights-syntax-string-regexp:#116329;
--color-prettylights-syntax-markup-deleted-text:#82071e;
--color-prettylights-syntax-markup-deleted-bg:#ffebe9;
--color-prettylights-syntax-markup-inserted-text:#116329;
--color-prettylights-syntax-markup-inserted-bg:#dafbe1;
--color-prettylights-syntax-constant-other-reference-link:#0a3069;
--color-fg-default:#24292f;
--color-fg-muted:#57606a;
--color-canvas-default:#fff;
--color-canvas-subtle:#f6f8fa;
--color-border-default:#d0d7de;
--color-border-muted:#d8dee4;
--color-neutral-muted:rgba(175,184,193,.2);
--color-accent-fg:#0969da;
--color-accent-emphasis:#0969da;
--color-danger-fg:#cf222e
}
}
[data-color-mode=light][data-light-theme=dark],[data-color-mode=dark][data-dark-theme=dark]{
--color-canvas-default-transparent:rgba(13,17,23,0);
--color-prettylights-syntax-comment:#8b949e;
--color-prettylights-syntax-constant:#79c0ff;
--color-prettylights-syntax-entity:#d2a8ff;
--color-prettylights-syntax-storage-modifier-import:#c9d1d9;
--color-prettylights-syntax-entity-tag:#7ee787;
--color-prettylights-syntax-keyword:#ff7b72;
--color-prettylights-syntax-string:#a5d6ff;
--color-prettylights-syntax-variable:#ffa657;
--color-prettylights-syntax-string-regexp:#7ee787;
--color-prettylights-syntax-markup-deleted-text:#ffdcd7;
--color-prettylights-syntax-markup-deleted-bg:#67060c;
--color-prettylights-syntax-markup-inserted-text:#aff5b4;
--color-prettylights-syntax-markup-inserted-bg:#033a16;
--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;
--color-fg-default:#c9d1d9;
--color-fg-muted:#8b949e;
--color-canvas-default:#0d1117;
--color-canvas-subtle:#161b22;
--color-border-default:#30363d;
--color-border-muted:#21262d;
--color-neutral-muted:rgba(110,118,129,.4);
--color-accent-fg:#58a6ff;
--color-accent-emphasis:#1f6feb;
--color-danger-fg:#f85149
}
@media (prefers-color-scheme:light){
[data-color-mode=auto][data-light-theme=dark]{
--color-canvas-default-transparent:rgba(13,17,23,0);
--color-prettylights-syntax-comment:#8b949e;
--color-prettylights-syntax-constant:#79c0ff;
--color-prettylights-syntax-entity:#d2a8ff;
--color-prettylights-syntax-storage-modifier-import:#c9d1d9;
--color-prettylights-syntax-entity-tag:#7ee787;
--color-prettylights-syntax-keyword:#ff7b72;
--color-prettylights-syntax-string:#a5d6ff;
--color-prettylights-syntax-variable:#ffa657;
--color-prettylights-syntax-string-regexp:#7ee787;
--color-prettylights-syntax-markup-deleted-text:#ffdcd7;
--color-prettylights-syntax-markup-deleted-bg:#67060c;
--color-prettylights-syntax-markup-inserted-text:#aff5b4;
--color-prettylights-syntax-markup-inserted-bg:#033a16;
--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;
--color-fg-default:#c9d1d9;
--color-fg-muted:#8b949e;
--color-canvas-default:#0d1117;
--color-canvas-subtle:#161b22;
--color-border-default:#30363d;
--color-border-muted:#21262d;
--color-neutral-muted:rgba(110,118,129,.4);
--color-accent-fg:#58a6ff;
--color-accent-emphasis:#1f6feb;
--color-danger-fg:#f85149
}
}
@media (prefers-color-scheme:dark){
[data-color-mode=auto][data-dark-theme=dark]{
--color-canvas-default-transparent:rgba(13,17,23,0);
--color-prettylights-syntax-comment:#8b949e;
--color-prettylights-syntax-constant:#79c0ff;
--color-prettylights-syntax-entity:#d2a8ff;
--color-prettylights-syntax-storage-modifier-import:#c9d1d9;
--color-prettylights-syntax-entity-tag:#7ee787;
--color-prettylights-syntax-keyword:#ff7b72;
--color-prettylights-syntax-string:#a5d6ff;
--color-prettylights-syntax-variable:#ffa657;
--color-prettylights-syntax-string-regexp:#7ee787;
--color-prettylights-syntax-markup-deleted-text:#ffdcd7;
--color-prettylights-syntax-markup-deleted-bg:#67060c;
--color-prettylights-syntax-markup-inserted-text:#aff5b4;
--color-prettylights-syntax-markup-inserted-bg:#033a16;
--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;
--color-fg-default:#c9d1d9;
--color-fg-muted:#8b949e;
--color-canvas-default:#0d1117;
--color-canvas-subtle:#161b22;
--color-border-default:#30363d;
--color-border-muted:#21262d;
--color-neutral-muted:rgba(110,118,129,.4);
--color-accent-fg:#58a6ff;
--color-accent-emphasis:#1f6feb;
--color-danger-fg:#f85149
}
} |
style.js is a example the custom styles?
Becasuse style.js doesn`t support all markdown
Or am i doing it wrong
The text was updated successfully, but these errors were encountered: