I have the following code which makes a window with a red background. This is achieved by creating some CSS with a class (.flibble) and assigning the CSS provider and class to the window.
window = Gtk.Window(title="Hello World")
window.show()
cssProvider = Gtk.CssProvider()
cssProvider.load_from_data(""".flibble { background-color: red; }""".encode())
styleContext = window.get_style_context()
styleContext.add_provider(cssProvider,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
styleContext.add_class("flibble")
Now the question is how I do the equivalent of the following Javascript which with an HTML DOM styles an individual element, without defining a class, nor adding it to the class list of an element:
element.style.backgroundColor = "red"