Returns the optional label CSS class to use when rendering a field template.

        By default, returns the Form class property `field_label_css_class`. If the
        field has errors and the Form class property `field_label_invalid_css_class`
        is defined, its value is appended to the CSS class.

        :param bound_field: `BoundField` instance to return CSS class for.
        :return: A CSS class string or `None`

def get_field_label_css_class(self, bound_field):
        """
        Returns the optional label CSS class to use when rendering a field template.

        By default, returns the Form class property `field_label_css_class`. If the
        field has errors and the Form class property `field_label_invalid_css_class`
        is defined, its value is appended to the CSS class.

        :param bound_field: `BoundField` instance to return CSS class for.
        :return: A CSS class string or `None`
        """
        class_name = self.field_label_css_class

        if bound_field.errors and self.field_label_invalid_css_class:
            class_name = join_css_class(
                class_name, self.field_label_invalid_css_class)

        return class_name or None