1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
    cicts is on a distinguished road

      0  

    Default Applying Custom CSS or theme chnages

    Applying Custom CSS or theme chnages


    Can i change the look and feel of a component in extjs 4 , I am a newbie just trying my hands .
    I want to change some of the styling of components like buttons

    any ideas?

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,331
    Vote Rating
    76
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi,

    you can give custom css your Ext component as like:

    Code:
        { 
                    xtype: 'button'
                    , text: 'Click Me!'
                    , cls: 'buttonT'          //custom css 
              }
    CSS:

    Code:
     <style type="text/css">
            .buttonT{ background:red !important; border:solid 1px red !important; width:200px !important;}
        </style>
    OUTPUT:

    btna.png
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Touch Premium Member suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    345
    Vote Rating
    17
    suzuki1100nz will become famous soon enough suzuki1100nz will become famous soon enough

      0  

    Default


    Hi,

    When you've got through with trying to customize Sencha components using css overrides you could have a look at the theming guides for how to create a site themed your way.

    have a look at. http://docs.sencha.com/ext-js/4-0/#/guide/theming

    and http://docs.sencha.com/ext-js/4-0/#!/video/19159630

    SASS and Compass are a fantastic tools and by simply changing some base variables you can change the look/color of an entire Sencha application.
    The same toolset is used with the Sencha Touch framework.

    We built an application and changed the $basecolor variable and it changed the color of 90% of the Sencha components.

    All the best

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,169
    Vote Rating
    28
    jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough

      0  

    Default


    What ever you choose, be sure to use one way of formatting your code.

    Jay Garcia @ModusJesus || Modus Create co-founder
    Ext JS in Action author
    Sencha Touch in Action author

    Get in touch for Ext JS & Sencha Touch Touch Training

    We are also working on Video-based Sencha Touch training: Check it out here.

Tags for this Thread