0

Just wondering if it's possible to apply a *.css to a spark TextArea? If so, how?

RapsFan1981
  • 1,177
  • 3
  • 21
  • 61

1 Answers1

2
<fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    @namespace local "*";
    s|Label
    {
        color:#33494A;
        fontFamily: "ApexNew";
        fontSize: 14pt;
    }
    s|TextArea
    {
        color:#33494A;
        fontFamily: "ApexNew";
        fontSize: 14pt;
    }
    @font-face
    {
        fontFamily: "ApexNew";
        src:url('font/ApexNew-Medium.otf');
    }
</fx:Style>

or

<fx:Style source="something.css"/>

[something.css]

@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@namespace local "*";
s|Label
{
    color:#33494A;
    fontFamily: "ApexNew";
    fontSize: 14pt;
}
s|TextArea
{
    color:#33494A;
    fontFamily: "ApexNew";
    fontSize: 14pt;
}
@font-face
{
    fontFamily: "ApexNew";
    src:url('font/ApexNew-Medium.otf');
}
shaunhusain
  • 19,630
  • 4
  • 38
  • 51
  • Where does the CSS code go? I'm afraid I don't know anything about styling flex components – RapsFan1981 Feb 07 '12 at 21:26
  • You can include the CSS either inline or put it in a separate css file, I'll edit the answer above to show it inline, for the separate css file you would just copy the contents of the tag into another file called, something.css then do a – shaunhusain Feb 07 '12 at 21:40