dm-p / powerbi-visuals-html-content

Visualise column or measure values as HTML in your Power BI reports. Intended as a spiritual successor to the OG HTML Viewer custom visual, with some extra stuff thrown in.
MIT License
85 stars 18 forks source link

[BUG] Pseudo selectors not working #68

Closed jyngyconsulting closed 1 year ago

jyngyconsulting commented 2 years ago

Describe the bug

Pseudo-elements do not work

To Reproduce

Steps to reproduce the behavior:

  1. Go to CSS code
  2. Add the block with ::before
  3. run code
  4. No result.

Expected behavior

Styling should change according to child content block Screenshots/Workbook

If applicable, attach screenshots or a sample workbook with data suitable for public viewing to help explain your problem.

Power BI Setup (please complete the following information):

Visual Information (please complete the following information, available by right-clicking the visual in Power BI and selecting About):

Additional context

Add any other context about the problem here.

dm-p commented 1 year ago

Apologies for the delay in responding - I've been going through the issues list and have found a couple that have fallen through the cracks.

As far as I can tell, pseudo selectors are working as expected, e.g.:

Create a measure with a suitable selector and pseud selector, plus desired behavior:

<CSS> Pseudo Test = "
    img:hover {
        filter: grayscale(1);
    }
"

Add this to the visual's stylesheet and test:

https://github.com/dm-p/powerbi-visuals-html-content/assets/10572054/2989464b-16a1-47ab-bff0-5e1b00790378

If your case isn't working following a similar method, you can reopen with an example workbook reproducing your issue and I can investigate further.