Sunday, April 3, 2011

Flex pseudo-selectors

I have to add * Required to a ton of screens in Flex. In some places, I can't use more than one label. I need the asterisk to be as big as the text. The only idea I could come up with was:

.required:first-letter {
    font-size:30; 
}

Doesn't seem to work. Are pseuedo-selectors not implemented in Flex?

From stackoverflow
  • No, pseudo-selectors like that are unavailable in Flex. Flex CSS is very limited at the moment. Currently, in the 3.x branch of the Flex SDK, you can only use .styleName and ComponentType selectors.

    According to Adobe's Flex SDK Open Source site, there will be new advanced CSS selectors in Flex 4. The document does mention pseudo-selectors, but it appears that they will be available as a way to differentiate between component "states" rather than to access specific substrings in text. I'm guessing that your use-case is best implemented by using the htmlText property available on most text-based controls in Flex.

0 comments:

Post a Comment