How to add dynamic css for each node?
I think you're over-engineering things here.

If your CSS is per-node-specific and stored in the DB anyways, then why not just use a text field to store the CSS? You just need to create a field template to output the raw content of the field in a &lt;style scoped&gt; tag.