Marko
Marko

Reputation: 10992

How to override the Spark theme in Flex 4?

What kind of styling is there in the default Spark theme in Flex 4? And how to override the Spark theme? For example I want to provide another backgroundcolor and nothing happens, the color css works as intended. The CSS looks like this:

    <fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    @namespace local "*";

    global
    {
        font-family: Georgia;
        color: #260B01;
        content-background-color: Red;
        content-background-alpha: 0.8; 

    }
</fx:Style>

Upvotes: 0

Views: 946

Answers (1)

Constantiner
Constantiner

Reputation: 14221

Hmm. This code works fine:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";
        global {
            font-family: Georgia;
            color: #260B01;
            content-background-color: Red;
            content-background-alpha: 0.8;
        }
    </fx:Style>
    <fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
    ]]>
    </fx:Script>
    <s:List dataProvider="{new ArrayCollection(['First','Second'])}" />
</s:Application>

What did you expected and what is your result?

Upvotes: 1

Related Questions