Re: Proposal: Add utility class "ClassList"

2022-09-30 Thread Jacob Rief
Hey Carlton, in my opinion, the main use case would be to improve type safety, readability and to add a utility class for 3rd party packages. Someday, Django may add type hints and then this would be really beneficial. In Django itself, the mentioned method css_classes

Re: Proposal: Add utility class "ClassList"

2022-09-29 Thread Carlton Gibson
Hey Jacob. Thanks for this. Can I ask you to give a few examples of potential usages in Django, and showing the gain over use a set in these cases? I'm trying to imagine exactly what you have in mind, but I'm not entirely clear. Thanks again. Carlton On Friday, 23 September 2022 at

Proposal: Add utility class "ClassList"

2022-09-23 Thread Jacob Rief
In JavaScript each HTMLElement has a property named classList . This actually is a set allowing to *add* a single CSS class string, *remove* it and/or *toggle* it. If we would reimplement this as a Python class, methods such