kaigou: this is what I do, darling (Default)
锴 angry fishtrap 狗 ([personal profile] kaigou) wrote in [community profile] style_system2009-11-17 11:37 am

style system variables

Is it possible to set a variable to be another variable?

That is, instead of:

set color_thing = "#333366";

doing:

set color_thing = $*some_other_thing;

such that the default value of $*color_thing is equal to the value of $*some_other_thing, but with option for user to override?
branchandroot: oak against sky (Default)

[personal profile] branchandroot 2009-11-17 06:39 pm (UTC)(link)
Right inside your print_stylesheet function, you should be able to require that variable x equal variable y. But that would screw with the ability of the user to select something totally different if that's what floats their boat. So I guess either you want to frame your x=y statement in such a way that if the values are changed they decouple, or else just set both variables to the same thing up in the settables list. *rueful* I usually go with the latter, despite it being longhand, as it were.