• I have copied pdf-styles.php to my child theme, but majority of the styles can’t be rewritten – no clue why.

    table > dt styles font get any changes: color, font weight, nothing is working. If I delete all of the styles, the PDF becomes styleless, but changing the styles doesn’t work.

    Any ideas why ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author David Jensen

    (@dkjensen)

    This plugin uses the mPDF library under the hood, most but not all CSS will work. Here is a the supported CSS you can use. In your case, make sure you are using td and not dt, and also <td> is not a direct descendent of the <table> so the CSS table > td would not work anyways. Try simply using the following to see if it works:

    td {
        color: red;
        font-weight: bold;
    }
    Thread Starter ItzCookie

    (@sawsainis)

    dl, dd and dt are used for product meta data and variation data. For example: product color, brand etc.

    Non of them are targeted by CSS. I have found a workaround, so you can close this, but for the future, this somehow should be resolved.

    Plugin Author David Jensen

    (@dkjensen)

    I see, you can still style dl, dd and dt using all the common text styles, however you would use table dt {} and not table > dt {} as <dt> is not a direct descendent of <table> so that would not work.

    • This reply was modified 1 year, 2 months ago by David Jensen.
    Thread Starter ItzCookie

    (@sawsainis)

    Very weird. I’ve tried “color” with different combinations targeting dd or dt, and neither of them worked ??

    I did table dt, table td dt, table > td > dt etc. Neither of them worked. Probably related to mPDF…

    Plugin Author David Jensen

    (@dkjensen)

    OK understood. I will test this locally today and get back to you. If there is other CSS that didn’t work as well if you could share that as well I will see if I can get this sorted for you.

    Plugin Author David Jensen

    (@dkjensen)

    So it looks like nested selectors won’t work with mPDF at least on the dt element. If you use the following it should work however:

    dt {
        color: red;
        font-weight: bold;
    }

    e.g. this won’t work

    table dt {
        color: red;
        font-weight: bold;
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PDF Styles not working’ is closed to new replies.