Too hot one minute, too cold the next. Anyone who’s engaged in office warfare over the air conditioning can tell you that trying to keep everyone happy is impossible. But what if we all wore clothing that adjusted to us, rather than having to fiddle with the temperature dial?

A new fabric, developed by a team at the University of Maryland, is the first to automatically warm wearers up or cool them down as needed. When you’re feeling hot and sweaty—when playing sports, say— the fabric lets infrared radiation (heat, to you and me) pass through. But when you’re colder and drier, it traps the heat in.

It was created using specially-engineered yarn created with fibers made of two different synthetic materials: one that absorbs water and one that repels it. The strands are coated with carbon nanotubes. Each fiber expands or contracts when the temperature changes.