Classes

class bootlace.util.Classes(tag: html_tag)[source]

Bases: MutableSet[str]

A helper for manipulating the class attribute on a tag.

Methods Summary

add(*classes)

Add classes to the tag.

clear()

This is slow (creates N new iterators!) but effective.

discard(value)

Remove a class if it exists.

isdisjoint(other)

Return True if two sets have a null intersection.

pop()

Return the popped value.

remove(*classes)

Remove classes from the tag.

swap(old, new)

Swap one class for another.

Methods Documentation

add(*classes: str) html_tag[source]

Add classes to the tag.

clear()

This is slow (creates N new iterators!) but effective.

discard(value: str) None[source]

Remove a class if it exists.

isdisjoint(other)

Return True if two sets have a null intersection.

pop()

Return the popped value. Raise KeyError if empty.

remove(*classes: str) html_tag[source]

Remove classes from the tag.

swap(old: str, new: str) html_tag[source]

Swap one class for another.