fralau / mkdocs-macros-plugin

Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code.
https://mkdocs-macros-plugin.readthedocs.io
Other
321 stars 50 forks source link

macro_info does not support dark material theme. #152

Closed asyncmind0 closed 1 year ago

asyncmind0 commented 1 year ago

The minions of darkness are not pleased :)

workaround:

table{
    background-color: initial !important;
}
image
github-actions[bot] commented 1 year ago

Welcome to this project and thank you!' first issue

fralau commented 1 year ago

What is the status of that issue?

fralau commented 1 year ago

@jagguli What is the status of this issue?

asyncmind0 commented 1 year ago

I have not yet tested without the workaround

fralau commented 1 year ago

I forced the color of the font to black, so the table will be readable even on a dark mode.

I appreciate that this creates discomfort to the minions of dark. As this is a debug function, I hope that this dose of radiation won't be lethal to them? 🙂

Otherwise, here is the code for the make_html() function in context.py:

def make_html(rows, header=[], tb_class='macros-tb'):
    "Produce an HTML table"
    font_color = "#000000"  # black
    back_color = "#F0FFFF"  # light blue
    grid_color = "#DCDCDC"
    padding = "5px"
    style = f"color:{font_color}; border:1px solid {grid_color}; padding: {padding}"
    templ = Template("""
<table class="{{ tb_class }}" style="background-color: {{ back_color}}; {{ style }}">
    {% for item in header %}
    <th style="{{ style }}">{{ item }}</th>
    {% endfor %}
    {% for row in rows %}
        <tr>
        {% for item in row %}
            <td style="vertical-align:top; {{ style }}">{{ item }}</td>
        {% endfor %}
        </tr>
    {% endfor %}
</table>
    """)
    return templ.render(locals())

Any modification of the css that works nicely in both cases would be appreciated (to be tested at least with the default template and mkdocs-material).

fralau commented 1 year ago

@jagguli What is the status of that issue for you?