Blake,
By the way, I can go either way.
I'm just telling you what I think when I see -tr-rule-ref. I think it does tell me something. I can look at it and think, this does something special for me. And with a design time tool, I can see my options are selector and property -- selector "Includes a selector", and property "Includes a property from a selector".

Jeanne Waldman wrote, On 4/9/2010 3:56 PM PT:
People are used to typing -tr-rule-ref to mean "This is a special rule, and I'm including something."
-tr-rule-ref:selector means "I'm including a selector"
-tr-rule-ref:property means "I'm including a property"

Blake Sullivan wrote, On 4/9/2010 2:51 PM PT:
Jeanne Waldman said the following On 4/8/2010 2:07 PM PT:
I like this idea. I was playing around with ways to combine the last two parameters, but nothing looked good. This looks good to me.
-tr-rule-ref: property("background-color", "af|foo{color}")


Jeanne,

I still like

background-color : -tr-property-ref("af|foo", "color")

better than the -tr-rule-ref versions, because I think that it looks cleaner. I'm using a normal CSS property assignment. I'm not totally hung up on it though and think that your version solves the problem of remembering what all of the parameters are and what their order is. Though the lack of values in the {} is unusual and developers might thing that they can specify weird stuff in here, like values and multiple properties.. I do think that advantages of reusing -tr-rule-ref are oversold, though. Since the skin author still needs to know about the new property() (or should it be -tr-property) and its syntax, which seems pretty much the same as -tr-property-ref. Actually the more I think about it, the less I like it. It isn't clear what the the -tr-rule-ref is doing for me here--it provides no extra information:

Here is a direct comparison, using the same name "property"

background-color : property("af|foo", "color") // Option 2 -tr-rule-ref : property("background-color", "af|foo{color}") // Option 3'

In either case, I still need to understand what "property()" does, so how does "-tr-rule-ref" help me? All it is doing is taking up the spot where I want to put the property that I want to assign to, forcing me to move it to the unnatural location as a parameter. -tr-rule-ref works the way it does because it allows multiple properties to be assigned at once, but if we are only picking out one property, this is a liability.

Of course, both syntaces could support the degenerate (and most common case) where the property names are the same. Copying the background-color property:

background-color : property("af|foo")                     // Option 2
-tr-rule-ref : property("background-color", "af|foo") // Option 3'

-- Blake Sullivan


Alan Yu wrote, On 4/8/2010 12:47 PM PT:
To make it more clear, maybe we can combine the last two parameters into a single one like: "af|foo{color}". Also, if "{color}" is omitted, the property name specified in parameter 1 will be pulled.

Thanks,
-Alan

On 4/8/2010 11:32 AM, Jeanne Waldman wrote:
I like Option 3 as well. It's still fairly short, and it uses a convention we already have. It is a little unclear which parameter you are setting (background-color in this example) and which you are pulling from the selector (color).

Alan Yu wrote, On 4/5/2010 2:31 PM PT:
Hi Jeanne,
I didn't know we have a third option to consider: -tr-rule-ref: property("background-color", "af|foo", "color").
I'd vote for option #3 for the following reasons:
1. The syntax is consistent with -tr-rule-ref:selector(...).
2. It is intuitive if you're already familiar with "-tr-rule-ref:selector(...)". 3. Option #2 can be confusing to the user since the keyword "-tr-rule-ref" can be used both as a property name and a value. 4. From DT's perspective, it's easier to support since we only need to provide another possible value (property(...), vs. selector(...) to "-tr-rule-ref") to help with user's selection in the PI.

Thanks,
-Alan

On 4/5/2010 1:56 PM, Jeanne Waldman wrote:
you can remove the Fwd, and reply-to d...@myfaces.apache.org.

-------- Original Message --------
Subject: Re: [Trinidad][Skinning][API] Include property in CSS API
Date: Fri, 02 Apr 2010 12:04:23 -0700
From: Jeanne Waldman <jeanne.wald...@oracle.com>
Reply-To: MyFaces Development <dev@myfaces.apache.org>
To: MyFaces Development <dev@myfaces.apache.org>
References: <n2z16f5365c1004020028l81278c5fv9b834da89c013...@mail.gmail.com>

We don't have a -tr-include-style. We have a -tr-rule-ref:selector.
So if we did #1, I would go for -tr-rule-ref:property instead of
-tr-include-property.

1': -tr-rule-ref:property(selector="af|foo",propertyName="color",
localPropertyName="background-color")
3. -tr-rule-ref: property("background-color", "af|foo", "color"); // or
something like this to make it shorter.

Right now I'm leaning towards 2.
2':
background-color: -tr-rule-ref:property("af|foo", "color");


Marius Petoi wrote, On 4/2/2010 12:28 AM PT:
Hello,

Maybe you followed the discussions on this topic from http://markmail.org/search/?q=skinning#query:skinning%20order%3Adate-backward+page:1+mid:4nt2ykmdnnmcyvp4+state:results

We need to decide between two alternatives for the syntax of the "-tr-include-property". The two alternatives are:

1. -tr-include-property: property(selector="af|foo",propertyName="color", localPropertyName="background-color")

2. background-color : -tr-property-ref("af|foo", "color")

The advantage of the first API is that it is quite similar to the "-tr-include-style", while for the second one that the local property name can't be mistaken with the included property.

What do you think? Which is the best alternative?

Regards,
Marius







Reply via email to