1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    19
    Vote Rating
    0
    jastako is on a distinguished road

      0  

    Default Answered: Styling UI

    Answered: Styling UI


    Hi there,

    Whenever I try to custom style UI, using 'style' member, ST2 somehow loses information about first items in CSS block.

    Given example (CoffeeScript):

    Code:
        Ext.Viewport.add
          xtype: 'panel'
          scrollable: true
          fullscreen: true
    
          defaults:
            style: """
                    div.red
                    {
                      bugfix_placeholder: 0;
                      color: red;
                      display: inline-block;
                    }
    
                    div.yellow
                    {
                      bugfix_placeholder: 0;
                      color: yellow;
                      display: inline-block;
                    }
    
                    div.green
                    {
                      bugfix_placeholder: 0;
                      color: green;
                      display: inline-block;
                    }
                    """
            #styleHtmlContent: true
    
          items: [
            {
            html : "<div class='yellow'>aaa</div>"
            },
            {
            html : "<div class='red'>bbb</div>"
            },
            {
            html : "<div class='yellow'>ccc</div>"
            },
            {
            html : "ddd"
            },
          ]
    1) 'bugfix_placeholder: 0' has been added to each CSS block definition as a first item. This lets consequent items in block be correctly processed.
    2) all elements (incl. 'ddd') are green.

    Is this just me or bugs in ST2?

  2. The style config doesn't take CSS, it takes rules.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,119
    Vote Rating
    453
    Answers
    3160
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    The style config doesn't take CSS, it takes rules.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    19
    Vote Rating
    0
    jastako is on a distinguished road

      0  

    Default


    Thanks for info!

Tags for this Thread