1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    21
    Answers
    1
    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
    Gainesville, FL
    Posts
    37,206
    Answers
    3517
    Vote Rating
    856
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The style config doesn't take CSS, it takes rules.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

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

      0  

    Default


    Thanks for info!

Thread Participants: 1

Tags for this Thread