does it sound like you want to write an interpreter for css? if it is entered manually in the text, then using it later will be as simple as copying and pasting it into a css file.
so if you have a text area on your page for css input and you want to apply these rules at the click of a button, you can use something like this (only pseudo code, you need to work):
//for each css id in the text area $.each($('textarea[name=cssTextArea]').html().split('#'), function({ //now get each property $.each($(this).split(';'), function(){ $(elem).css({property:value}); }); });
then you could write something to go through each element your designer introduced and get the current CSS rules for it (including the ones you applied using some code, for example, the snippet above) and create a css line from what could then be deduced or stored in db. This is a pain and a lot of falsification with substrings, but, unfortunately, I do not know a faster or more efficient way.
Hope this at least gives you some ideas.
source share