markdown-pdf icon indicating copy to clipboard operation
markdown-pdf copied to clipboard

Missing information for writing user-provided CSS files

Open andy-maier opened this issue 5 years ago • 1 comments

I did not find any information about writing user-provided CSS files.

I am not asking for general information about CSS, but instead whatever about CSS is specific to markdown-pdf. For example, the intermediate HTML that is created by markdown-pdf uses HTML elements in certain ways that need to be understood for reasonable CSS style sheets to be written by a user.

andy-maier avatar Jun 26 '20 11:06 andy-maier

To give one practical example where it is necessary to understand this:

Adding this to the CSS file:

table, tr, th, td {
    border: 1px solid black;
    page-break-inside: avoid;
}

th {
    font-weight: bold;
}

does not render the table headings in bold font as one would expect, because supposedly, the first row of the table is not represented using the TH tags in the intermediate HTML.

In my markdown, I use this table format:

| Name | Value |
|:---- |:----- |
| P1   | 1     |

So at the markdown level, there is a definition of what the header is, and that header is by default rendered in bold font for example on GitHub.

Update: I tried several variations of this and ended up being unable to get the table header to be bold.

andy-maier avatar Jun 26 '20 11:06 andy-maier