Results 1 to 5 of 5

Thread: Are all SASS mixin arguments required?

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2013
    Location
    Slovakia
    Posts
    80
    Answers
    2

    Default Answered: Are all SASS mixin arguments required?

    Hi,
    my question is: when using SASS mixin to create new UI for a component (e.g. Button), are the all mixin arguments required or do I have to use all the arguments? For example, if I want to create new Button UI, and all I need to change are colors (text color and background color), how to do it? Thanks.

  2. you only need to set the values for parameters you need.

    take a look at:
    http://docs.sencha.com/extjs/4.2.2/#!/guide/theming
    Code:
    @include extjs-panel-ui(
        $ui-label: 'highlight-framed',
        $ui-header-background-color: red,
        $ui-border-color: red,
        $ui-header-border-color: red,
        $ui-body-border-color: red,
        $ui-border-width: 5px,
        $ui-border-radius: 5px
    );

  3. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130

    Default

    you only need to set the values for parameters you need.

    take a look at:
    http://docs.sencha.com/extjs/4.2.2/#!/guide/theming
    Code:
    @include extjs-panel-ui(
        $ui-label: 'highlight-framed',
        $ui-header-background-color: red,
        $ui-border-color: red,
        $ui-header-border-color: red,
        $ui-body-border-color: red,
        $ui-border-width: 5px,
        $ui-border-radius: 5px
    );
    Best regards
    Tobias Uhlig

  4. #3
    Sencha Premium Member
    Join Date
    Oct 2013
    Location
    Slovakia
    Posts
    80
    Answers
    2

    Default

    Thank you for your answer, but then I have one more question: if I use only some of the mixin's arguments, like you did in the previous example, what will be the values of other not used arguments? Their values will be inherited from 'default' ui for a component? Thanks.

  5. #4
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130

    Default

    for buttons this changed a while ago:
    ext/packages/ext-theme-neutral/sass/src/button/Button.scss

    Code:
    /**
     * Creates a visual theme for a Button.  This mixin is not {@link #scale} aware, and therefore
     * does not provide defaults for most parameters, so it is advisable to use one of the
     * following mixins instead when creating a custom buttonUI:
     *
     * #extjs-button-small-ui - creates a button UI for a small button
     * #extjs-button-medium-ui - creates a button UI for a medium button
     * #extjs-button-large-ui - creates a button UI for a large button
     * #extjs-button-toolbar-small-ui - creates a button UI for a small toolbar button
     * #extjs-button-toolbar-medium-ui - creates a button UI for a medium toolbar button
     * #extjs-button-toolbar-large-ui - creates a button UI for a large toolbar button
    extjs-button-ui does not provide default values, the other (real) button UIs do. Panels provide default values depending on the theme you use as well.
    Best regards
    Tobias Uhlig

  6. #5
    Sencha Premium Member
    Join Date
    Oct 2013
    Location
    Slovakia
    Posts
    80
    Answers
    2

    Default

    Thank you, this is very interesting and new information to me. Anyway, I supose these special button UIs are new to Ext JS 4.2.2 release. Am I right?

Posting Permissions

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