First post here! I am having trouble getting a css class snippet to render in live preview mode. Specifically, I am trying to make progress bars half as wide (from 220 down to 110px) so they look better in Dataview tables with the use of ‘cssclasses: narrow-progress’.
I am using Minimal theme and its css code contains this:
When I try adding ‘.narrow-progress’ in front of that snippet, the width renders correctly in both reading and live preview modes, but in ALL my files instead of just the ones with the cssclasses: narrow-progress property. Here’s the code:
it then responds to the use of the cssclass…but only in Reading View. It does not work in Live Preview.
I am not experienced with CSS, so apologies if this is a stupid question, but does anyone know how I can get the narrow-progress class to both respond to the cssclasses property AND render in both reading and live preview modes? Thanks!
Thanks a lot for the input. Here’s the Dataview query that is producing the progress bars:
```dataview
TABLE WITHOUT ID
file.link AS Module,
description AS Description,
deadline as Deadline,
status AS Status,
progress AS Progress
FROM #project AND #CFWI/Cohorts AND -"System"
SORT file.name ASC
The progress bars are in the 'Progress' column and are referencing this dataviewjs query from the other files:
$= const value = Math.round(((dv.page("filename").file.tasks.where(t => t.completed).length) / (dv.page("filename").file.tasks).length || 0) * 100); "<progress value='" + value + "' max='100'></progress>" + " " + value + "%"