Flex 4 pseudo-selectors with CSS

Flex 4 offers a selector for css descendants and pseudo selectors, for example:

s|DropDownList:open {
    font-size: 11;
}

s|DropDownList #labelDisplay {
    font-size: 12;
}

However, if I combine these two who wanted to do something like this, it does not work:

s|DropDownList:open #labelDisplay {
    font-size: 13;
}

Is this possible with streaming pseudo selectors?

(Of course, I could use the property styleName.openon labelDisplay, but I think using pseudo selectors is a more elegant solution)

+3
source share
2 answers

It looks like it might be a Flex bug.

When the pseudo selector :openis not yet used, the descendant style is not applied, as you discovered:

    s|DropDownList #labelDisplay {
        font-size: 12;
    }
    s|DropDownList:open #labelDisplay {
        font-size: 14;
    }

But if you use a pseudo selector; even empty, without style information; he seems to fix this:

    s|DropDownList #labelDisplay {
        font-size: 12;
    }
    /* this line fixes it */
    s|DropDownList:open {}
    s|DropDownList:open #labelDisplay {
        font-size: 14;
    }

sdk 4.0, 4.1 4.5. , .

0

s|DropDownList:open, s|DropDownList #labelDisplay{
fontSize: 13;

}

0

Source: https://habr.com/ru/post/1745989/


All Articles