textual icon indicating copy to clipboard operation
textual copied to clipboard

A method of overriding the name of a DOMNode-descended class for CSS purposes

Open davep opened this issue 1 year ago • 0 comments

As I understand it right now, if I create a class such as this:

class AppHeader( Widget ):
   ...

then in the CSS I can style it by referring to it as AppHeader. For example:

AppHeader {
    dock: top;
    background: black;
    color: white;
}

Prompted by the fact that I was experimenting the other day with using Textual from Hy, where I'd be more likely to find myself creating classes using kebab-case rather than SnakeCase, and where I was trying to share the same stylesheet between the Python and Hy versions of the code, it got me thinking that perhaps it would be useful to allow an override of the name?

While the above is likely a fairly obscure motivation for doing so, I can imagine it being more generally useful in more common situations.

davep avatar Aug 12 '22 16:08 davep