QGIS Styles have powerful dynamic features and you can compute style attributes from data, functions, or project variables.

I needed to quickly generate several different versions of the same map with different colors for comparison. I knew that I could use variables to control this, but I wanted to understand if I could refer to a layout defined variables and if these could be overridden by the layout map element.