I think I may be missing something, because, IMO, the Royale way is to use
Themes.  Weren't you working on a VividBlue theme?

I suppose Themes might be a bit heavier than true string/variable
substitution, but I think there is property overriding in the compiler.
I'm not sure order of theme SWCs is preserved and used, but maybe we can
implement that if that's what is needed.

I think if JewelTheme.swc specifies:

Button {
  background-color: white;
}

And JewelBlueTheme.swc specifies

Button {
  background-color: blue;
}

That both will be output in the CSS in that order and blue will win.  It
might be that the compiler already can tell that there is a later Button
selector with background-color and can choose not to output the
"background-color: white".  If that doesn't exist already, we can probably
make it happen.

I think on the command line, you would specify -theme=JewelTheme.swc and
-theme=JewelBlueTheme.swc.

String substitution is possible.  I'm about to push code that allows
simple member access expressions as compiler defines so there is already a
form of substitution in the AS compiler.

HTH,
-Alex


On 3/7/18, 11:14 PM, "carlos.rov...@gmail.com on behalf of Carlos Rovira"
<carlos.rov...@gmail.com on behalf of carlosrov...@apache.org> wrote:

>Hi Alex, Om,
>
>I'm referring to what Om's describe. In MDL and the rest of frameworks we
>pass for example "primary" and "accent" color. In this way the final CSS
>gets the colors in all rules they need to use hardcoded. Please check the
>following link:
>
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgetmdl.io
>%2Fcustomize%2Findex.html&data=02%7C01%7Caharui%40adobe.com%7C7ee10b52100d
>4931824e08d584c450aa%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63656090
>1060420372&sdata=YwCDV9HX4XIFn2O%2B2L90UaoHu9tKAEOPwTDdwViUQWo%3D&reserved
>=0
>
>then we get a CSS with the colors applied. This is done with SASS
>processing, but I was asking if we can get this out-of-the-box with royale
>since we are using a compiler, or we have another trick that we could use
>to get the same result. Another way with CSS could be to use variables in
>CSS but maybe this is not still part of the actual browsers support or we
>don't support it in our CSS processing.
>
>If not, I'll need to introduce SASS processing in the chain in some way.
>
>
>
>2018-03-08 4:33 GMT+01:00 OmPrakash Muppirala <bigosma...@gmail.com>:
>
>> Carlos,
>>
>> In SASS, there are variables, but you cannot pass variables into it from
>> the app.  The variables in SASS are compiled down to CSS as hardcoded
>> values, that's it.
>>
>> Usually, multiple class values are created and we set the class
>>property on
>> an element using a string evaluation.
>>
>> For example:
>>
>> var colorName = this.hasWarning() ? "Red" : "Blue";
>> var className:String = "button" + colorName + "Class";
>>
>> element.setAttribute("class", className);
>>
>> In the css:
>>
>> .buttonRedClass {
>>     color: darkred;
>> }
>>
>> .buttonBlueClass {
>>     color: lightskyblue;
>> }
>>
>> This is one way of doing things.
>>
>> The other way is to directly set the .style property of the element and
>> apply the color there.  Not very elegant, but should work.
>>
>> Hope that helps.
>>
>> Thanks,
>> Om
>>
>> On Wed, Mar 7, 2018 at 3:18 PM, Carlos Rovira <carlosrov...@apache.org>
>> wrote:
>>
>> > Hi,
>> >
>> > I'd need to pass two or three colors to a CSS (i.e: primary, secondary
>> and
>> > accent)
>> > in other frameworks people use things like SASS
>> > Maybe in Royale we could get it in our own way
>> >
>> > any suggestion so that I could test?
>> >
>> > thanks!
>> >
>> > --
>> > Carlos Rovira
>> > 
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%
>>2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C7ee10b52100d4931824e08
>>d584c450aa%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63656090106042037
>>2&sdata=LirhMtyi6j2OLZIvI0BFOPxXMurqUIoOIC7fqisx8oc%3D&reserved=0
>> >
>>
>
>
>
>-- 
>Carlos Rovira
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2
>Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C7ee10b52100d4931824e08d5
>84c450aa%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636560901060420372&s
>data=LirhMtyi6j2OLZIvI0BFOPxXMurqUIoOIC7fqisx8oc%3D&reserved=0

Reply via email to