On 2/17/17, 10:49 PM, "Justin Mclean" <jus...@classsoftware.com> wrote:

>Hi,
>
>> For the most part, SimpleCSSStyles contains styles we have at least
>> attempted to support in the SWF side.  So if you want to add fancier
>> background styles it would be nice to add a background bead that
>>supports
>> it.
>
>I looked into that the issue I think is that SimpleCSSStylesValueImpl has
>several static objects such as inheritingStyles, perInstanceStyles,
>colorStyles etc etc and you would need to modify from the bead. Can you
>do that?
>
>Alternatively you could make  you own SlightlyMoreComplexValueImpl
>extending from SimpleCSSStylesValueImpl and modify those styles in it’s
>constructor. However then I think you run into an issue with this. Say I
>add ExtraBorderStyleBead and ExtraBackgroundStyleBead I can’t see how I
>can include both BorderCSSStylesValueImpl and BackroundCSSStylesValueImpl.
>
>Is the alternative really only to just make your own
>AllTheThingsCSSStylesValueImpl rather than being able to break it up into
>reusable parts that deal with borders, background, text formatting etc
>ect?

Well, it is all supposed to be PAYG.  If your app only needs padding and
fancy borders and backgrounds, then you could write a custom IValuesImpl
that only supports those things and it would be way smaller and faster
than AllTheThingsCSSStylesValueImpl.  For sure, someone should go and
write AllTheThingsCSSStylesValueImpl and we'd make it the default in the
Express package.  Then someone desperate to save a few bytes would copy
it, comment out what they don't need and be good to go.

Someone could also create an IValuesImpl that is a strand that can take
beads that support various subsets of CSS.  It would have higher overhead
relaying between the beads, but so what?  It's all good.  There is no one
right answer and FlexJS doesn't try to make everyone do things one
particular way.  There are lots of trade-off involving speed, size,
runtime dynamics, etc.

My 2 cents,
-Alex

Reply via email to