Other forms: levities
Joking that your dead grandmother "never looked better" could inject some levity, or frivolity, into her funeral, but your relatives might find your joke inappropriate to the occasion.
Levity literally means "lightness," and it's often an attempt to inject some lightness or humor into an otherwise somber situation. Telling your Aunt Edna a joke while she recuperates from a skiing accident could provide the levity needed to brighten her mood. Yet levity is often used to describe humor that's not appropriate to the occasion, like telling jokes during a funeral.