Styling cells through metadata?

If you would like some pointers on where to look to implement this yourself as an extension, you could look at my jupyterlab-imarkdown extension. This extension provides its own NotebookPanel.IContentFactory, which it uses to override the behaviour of the Markdown cell.
This extension does several things, so there are several JupyterLab plugins in index.ts. You only need one to provide your custom factory. You can use the extension cookie-cutter to get started, and inherit directly from NotebookPanel.ContentFactory for your factory, (see jupyterlab-imarkdown/index.ts at 4a564a75ac85240670e4166c36fbbe3a865cb32e · agoose77/jupyterlab-imarkdown · GitHub)
You could subclass all of the cell types in your own factory, and listen to the cell model for changes to the metadata. This could then be used to add or remove classes, e.g. the MARKDOWN_CELL_CLASS added in MarkdownCell

2 Likes