If it was just me everything would be 8pt font and zero margin/padding
Anyway, there's that "Flex" in FlexDash... You be the boss! I copied the markdown widget into a custom widget, cut out some fluff, and tweaked the paragraph margins:
[{"id":"694f2b90fcd08117","type":"inject","z":"42aa3359d7ac96f5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":360,"wires":[["66ade629c7f44e53"]]},{"id":"66ade629c7f44e53","type":"function","z":"42aa3359d7ac96f5","name":"some text","func":"return { payload: `\n# Testing markdown\n\nThis is one paragraph with many many many many words\nthat goes on for ever and ever and ever.\n\nThis is a second paragraph.\n\nTrying again\n- and a bullet\n- second bullet\nTada!\n\n`}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":260,"y":360,"wires":[["e7b8b8127072bebb","327d0e73fdd45516"]]},{"id":"e7b8b8127072bebb","type":"fd-markdown","z":"42aa3359d7ac96f5","fd_container":"a96ede31d15e8fcc","fd_cols":"2","fd_rows":"4","fd_array":false,"fd_array_max":10,"name":"","title":"Markdown","popup_info":"","text":"- _Hello_ __!__","x":430,"y":360,"wires":[]},{"id":"327d0e73fdd45516","type":"flexdash custom","z":"42aa3359d7ac96f5","name":"MD custom","title":"My Markdown","sfc_source":"<!-- Markdown - Adaptation of the FLexDash Markdown widget -->\n<template>\n <v-card-text class=\"pt-0 flex-grow-1 flex-shrink-1 overflow-auto\">\n <md class=\"pt-1\" style=\"width:100%\">{{payload}}</md>\n </v-card-text>\n</template>\n\n<style scoped>\n :deep(p) { margin: 0px; }\n</style>\n\n<script>\nexport default {\n full_page: true, // tells the widget-wrapper to provide a full-page button\n props: {\n payload: { type: String, default: \"- _Hello_ __!__\" },\n },\n}\n</script>\n","fd_container":"a96ede31d15e8fcc","fd_cols":2,"fd_rows":4,"fd_array":false,"fd_array_max":10,"x":430,"y":400,"wires":[[]]},{"id":"a96ede31d15e8fcc","type":"flexdash container","name":"Repro","title":"","kind":"StdGrid","fd_children":",7d8110bad209c9b4,e7c4f917522b9e07,73d471ead270d371,0ca10a099f0a6969,1d8ee88fedb20405,e0dc4b448dc085ca,78673e91a6b52f72,e9b320e81e2e1981,e7b8b8127072bebb,078aa668f5bf1983,fea875a20cb7859d,327d0e73fdd45516","tab":"1e908252f3517797","min_cols":"6","max_cols":"20","unicast":"ignore","parent":"","solid":false,"cols":"1","rows":"1"},{"id":"1e908252f3517797","type":"flexdash tab","name":"Repros","icon":"mdi-view-dashboard","title":"Repro","fd_children":",a96ede31d15e8fcc","fd":"e8f5aea52ab49500"}]
Before:
After:
Not much code:
<!-- Markdown - Adaptation of the FLexDash Markdown widget -->
<template>
<v-card-text class="pt-0 flex-grow-1 flex-shrink-1 overflow-auto">
<md class="pt-1" style="width:100%">{{payload}}</md>
</v-card-text>
</template>
<style scoped>
:deep(p) { margin: 0px; }
</style>
<script>
export default {
full_page: true, // tells the widget-wrapper to provide a full-page button
props: {
payload: { type: String, default: "- _Hello_ __!__" },
},
}
</script>
The styles you're overriding are in the FlexDash markdown component. (Caveat: I've since made some small changes to use "style scoped" in the component, if the override doesn't work for you add a '!' after the CSS rule.)
The :deep(...)
is there because of "style scoped" and allows the match to propagate to inner components, e.g., the <md>
.
As usual, I'm here if you need help