Results 1 to 4 of 4

Thread: Add CSS/SASS in a Sencha CMD build

  1. #1
    Sencha User
    Join Date
    Jul 2011
    Location
    Holland
    Posts
    98
    Answers
    2

    Default Add CSS/SASS in a Sencha CMD build

    Good day,

    I've got one simple question about ExtJS, using Sencha CMD. What is the correct method of adding custom CSS (or Sass) code to the project? I prefer not adding a complete new theme, since the CSS instructions won't be that much.

    It's easy in Sencha Touch (using app.json), but that doesn't work in ExtJS. I've got the ExtJS in Action book and looked up the forums, I can't find an answer to this simple question.

    Thanks in advance,

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Answers
    512

    Default

    If it is a third party css, you can include it in index.html outside of x-compile block. If it is a sass then you put it in sass/src sass/var directories with names exactly as your views. For example if you have view app/view/MyView.js then you add sass to sass/var/view/MyView.scss and sass/src/MyView.scss.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  3. #3
    Sencha User
    Join Date
    Nov 2009
    Location
    Aveiro, Portugal
    Posts
    47
    Answers
    3

    Default Views inside folders

    Hi,

    I can create new ui if the view class is right below the view folder.

    For example, for a view Application/app/view/Welcome.js, I've created Application/sass/src/view/Welcome.scss and it works as expected. The same for other views defined below app/view/.

    But for a view inside a folder, like Application/app/view/Participation/Discussion.js, the ui defined in Application/sass/src/view/Participation/Discussion.scss DO NOT work.

    My Application/sass/src/view/Participation/Discussion.scss contains:

    Code:
    @include extjs-panel-ui(
        $ui-label: 'discussion',
        $ui-header-background-color: #2A3315,
        $ui-body-background-color: #2A3315,
        $ui-body-font-size: 12px
        );
    I also tried to define the ui in Application/sass/src/view/Viewport.scss but it doesn't work also.

    What am I missing?

    Thanks in advance.

  4. #4
    Sencha User
    Join Date
    Nov 2009
    Location
    Aveiro, Portugal
    Posts
    47
    Answers
    3

    Default Framed panel versus non framed panel

    Hi,

    Answering my question, the problem was the
    Code:
            extend : 'Ext.panel.Panel',    alias : 'widget.discussion',
        ui : 'discussion',
        frame : true,
    property that was generating a
    Code:
    discussion-framed
    CSS class.

    I changed my ui to:

    Code:
    @include extjs-panel-ui(
        $ui-label: 'discussion-framed',
        $ui-header-background-color: #2A3315,
        $ui-body-background-color: #2A3315,
        $ui-body-font-size: 12px
        );
    and now it works.

    Sorry for the noise.
    Last edited by jgrocha; 27 Sep 2014 at 7:44 AM. Reason: Title

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •