锴 angry fishtrap 狗 (
kaigou) wrote in
style_system2009-11-17 11:37 am
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
Entry tags:
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?
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?
no subject
-- layout defines property $X
-- layout sets $X = 'blue' ---> default value
-- theme sets $X = 'green' ---> default value for theme
-- user sets $X = 'red' ---> overrides all of the above
Right? So if instead of setting $X in the theme, I define it in the layout like so:
-- layout defines property $X
-- layout defines property $Y
-- layout sets $X = 'blue' ---> default value
-- layout sets $Y = true
-- layout function sez:
... if $Y is true, $X = 'blue', else $X = $Z
-- theme sets $Y = false
-- theme sets $Z = green
-- user sets $X = 'red' ---> overrides all of the above by setting $Y as true and $X as red, theme value is ignored
... OR I could just say to hell with it and do it long-hand, because this is like spending twenty dollars to save ten cents, isn't it.
no subject
layout:
property Color X { des = "base value" }
property Color Y { des = "falls back on base value if not provided" }
set X = "blue"
set Y = ""