PDA

View Full Version : Are all SASS mixin arguments required?



m.dostal
2 Dec 2013, 5:30 AM
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.

tobiu
2 Dec 2013, 6:01 AM
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


@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
);

m.dostal
2 Dec 2013, 11:39 PM
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.

tobiu
3 Dec 2013, 2:39 AM
for buttons this changed a while ago:
ext/packages/ext-theme-neutral/sass/src/button/Button.scss



/**
* 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.

m.dostal
3 Dec 2013, 5:49 AM
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?