You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by jude <fl...@gmail.com> on 2013/06/21 12:18:06 UTC

Adding support for CSS background and borders

In HTML and CSS you can specify the background and border on any container
and I think on any control. So for a button or div you can do this:

<input style="background:#ffffff url('img_tree.png') no-repeat right
top;border:border:5px solid red;border-right-style:none;"
type="button"/>


You can also point the background to an SVG file with url("button-up.svg").

In my opinion, this is one area where Flex is sorely lacking. Is there a
way to add support for this on every control? I know Border Container was
created as an alternative to Group because of performance reasons. But is
there a way to write it so that if it's not used it won't affect
performance?

Re: Adding support for CSS background and borders

Posted by Alex Harui <ah...@adobe.com>.
Seems like you could create a CSSBackground component that subclasses Skin
that becomes the base class of every skin of your theme.  Since most
components don't have CSS background styles set, the code wouldn't do much
unless needed.

One possible gotcha would be any components who derive their size from the
background-image as these would probably be loaded externally and not
available at measure time.

On 6/21/13 3:18 AM, "flexcapacitor@gmail.com" <fl...@gmail.com>
wrote:

>In HTML and CSS you can specify the background and border on any container
>and I think on any control. So for a button or div you can do this:
>
><input style="background:#ffffff url('img_tree.png') no-repeat right
>top;border:border:5px solid red;border-right-style:none;"
>type="button"/>
>
>
>You can also point the background to an SVG file with
>url("button-up.svg").
>
>In my opinion, this is one area where Flex is sorely lacking. Is there a
>way to add support for this on every control? I know Border Container was
>created as an alternative to Group because of performance reasons. But is
>there a way to write it so that if it's not used it won't affect
>performance?