Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Craft Dynamic CSS Plugin

Collect dynamic CSS in Craft Twig templates and output them in the master template.

Add CSS in Nested Blocks

{% 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.

Output CSS in Master Template

{% if craft.dynamiccss.get() != '' %}
  <style>
    {{ craft.dynamiccss.get() }}
  </style>
{% endif %}

About

Collect dynamic CSS in Craft Twig templates and add it to the master template

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages