Rich text - can you have a custom CSS class

Beginner here. I have a gatsby/contenful portfolio, and the body of each post is a rich text item, with text, images, video.

I want to design a post so by default images in the rich text are small but some with a class of say ‘fullwidth’ are full width.

Is that possible? Looking at the docs I think I need to do something with options/rendernode…