As @iantrich suggested, the card-modder has to be used inside the template card. The following works:
- type: 'custom:config-template-card'
config:
type: 'custom:card-modder'
style:
--paper-item-icon-color: "${ parseFloat(states['sensor.dow_futures_change_pct'].state) > 0 ? 'green' : 'red' }"
card:
type: 'custom:hui-entities-card'
title: Stocks
show_header_toggle: false
entities:
- entity: sensor.dow_futures
icon: "${parseFloat(states['sensor.dow_futures_change_pct'].state) > 0 ? 'mdi:arrow-up-bold-circle' : 'mdi:arrow-down-bold-circle' }"