zhlicen / md.htm

view markdown file directly
15 stars 7 forks source link

[HELP] Custom stylesheets for markdown #1

Open bogdan-the-great opened 11 months ago

bogdan-the-great commented 11 months ago

Hi! Custom stylesheets for markdown doesn't seem to work only with this script, but work with normal zero-md. I have a stylesheet that changes background to dark color and font color to white (in body).

zero-md example - working ``` Piotr's site

hi

``` ![image](https://github.com/zhlicen/md.htm/assets/37738748/e860592f-f27a-49b6-b3b9-986daacc0faf)
md.htm example - not working ``` Piotr's site

hi

``` ![image](https://github.com/zhlicen/md.htm/assets/37738748/989637f8-8f66-4a0a-87b2-ca8474b59c23)
a portion of style.css for reference ``` ... body { font-family: 'Open Sans'; mix-blend-mode: normal; background-color: #1d2021; color: #e8e6e3; } .container { text-align: center; } .title { display: inline-block; margin: 1%; } h1 { margin: 1%; text-decoration: underline; text-decoration-color: #337dff; } h2 { margin-top: 0%; text-decoration: underline; text-decoration-style: 3px solid; text-decoration-color: #337dff; } a { position: relative; } ... ```

I tried changing from <div style="width:70%; margin:0 auto;" id="mdcontainer"> to <div style="style.css" id="mdcontainer">, but it doesn't work too.

bogdan-the-great commented 11 months ago

Okay so after adding md.style.cssText = 'color:red !important;background-color:white'; to window.onload = function(), background changes, but text not. It seems that the color of text doesn't seem to be affected by stylesheet.