4 Replies Latest reply on Nov 6, 2007 9:00 AM by e_s_jp

    What is "Specific component with style name" ?

    e_s_jp
      Hi, I'm trying to use CSS Design View now.
      What is "Specific component with style name" ?

      I don't know how to use it.

      In "New Style Rule" dialog from "Convert to CSS" Button (Flex Properties panel) or "New Style" dialog from "New Style" Button (CSS Design View) , I chose Selector "Specific component with style name" and set Name "myLabel".

      It makes a CSS code such as "Label.myLabel{}" (Type Selector dot Class Selector) and a MXML code such as <mx:Label styleName="myLabel"> (only Class Selector?) .

      It is indistinguishable from Class selector .
      And in MXML Design View,it isn't shown on style ComboBox Menu in the Flex Properties panel.

      How I use that?
        • 1. Re: What is &quot;Specific component with style name&quot; ?
          Greg (Adobe)
          The "Specific component with style name" acts as a hint to CSS Design View and serves to document the purpose of the style. However, Flex itself ignores the component name portion of the name.

          So, if you have Label.myLabel{} in a css file and open that file in CSS Design View, you will see a preview of that style with a Label as the sample component. If you have just myLabel{}, CSS Design View will not know what to use as the sample component, so you would need to select the sample component from the combo box at the top of CSS Design View.

          In the MXML source code, Flex considers Label.myLabel and myLabel to be the same thing. This is a limitation of Flex and the MXML compiler. It ignores all characters before the dot in the style name.

          So, the Label.myLabel syntax is only useful in Flex Builder CSS Design View. It saves you from having to select Label as the sample component. We also consider it to be a good practice because it makes it clear from the name that the style is intended for use with a Label and not some other kinds of components.

          -- Greg Dow
          -- Adobe Flex Builder Team
          • 2. Re: What is &quot;Specific component with style name&quot; ?
            Peter Flynn (Adobe) Adobe Employee
            I've filed bug https://bugs.adobe.com/jira/browse/FB-10499 about the issue where the Style dropdown in Flex Properties doesn't list this type of CSS rule at all.

            - Peter
            • 3. Re: What is &quot;Specific component with style name&quot; ?
              e_s_jp Level 1
              Hi,Greg.
              Thank you for your answer.

              I also thought similarly.

              I was thinking that The "Specific component with style name" may act as only preview component to CSS Design View.

              Thanks.
              • 4. Re: What is &quot;Specific component with style name&quot; ?
                e_s_jp Level 1
                Hi,Peter.
                Thank you for your bug post!

                I also posted a other bug about CSS Style dialog.
                https://bugs.adobe.com/jira/browse/FB-10602

                Thanks.