Spain has 12 festivals in this guide, spread across 10 cities. They run in March, May, June, July and August, and festival-day temperatures range from 21°C (70°F) to 34°C (93°F), with nights down to 11°C (52°F). That range is the reason there is no single "Spain festival outfit". The answer changes by month and by site.
6 of them run in real heat (28°C or more), where loose natural fabrics beat coverage and a brimmed hat does more than any garment.
The ground matters as much as the sky. You will find city streets, island, industrial site, mountain and beach, which puts flat sandals you can rinse, plus trainers for the night stages at the top of the list for most of these events. 5 of the 12 have camping on site, so outfits have to survive living in a bag on the ground for several days.
Stylistically the crowd here leans beach, costume, elegant and indie. Las Fallas is the largest of them at around 1,000,000 people, and it sets the tone the smaller ones react to. None of that is a dress code. It is what you will see, which is worth knowing if you would rather blend in or deliberately not.