Collect dynamic CSS in Craft Twig templates and output them in the master template.
{% set style %}
#{{ id }} {
color: {{ block.textColor }};
background-color: {{ block.backgroundColor }};
}
{% endset %}
{{ craft.dynamiccss.set(style) }}
You can call set multiple times. All styles will be concatenated.
{% if craft.dynamiccss.get() != '' %}
<style>
{{ craft.dynamiccss.get() }}
</style>
{% endif %}