Get help from the marimo community

Updated 4 weeks ago

How to limit css (`<style>`) within a single cell?

In marimo, variables that should be local to a cell should be preceded with an underscore. I have different markdown cells, each of which should have a separate CSS. Unfortunately, it seems like the CSS "bleeds" into the rest of the notebook. Is there a way to contain styling (css) within a single cell?
M
J
2 comments
Could you create unique class names for each markdown? CSS is global and there are ways various ways to scope it but class names are the easiest
That is the solution that I use at the moment. It is not ideal, but workable. Using the approach in my marimo data visualisation tutorials at https://gitlab.kuleuven.be/aida-lab/teaching/g0r72a-tutorial-pythonsvg/
Add a reply
Sign up and join the conversation on Discord