You can use a personal css class to add to your container, use the config cls.
cls:
An optional extra CSS class that will be added to this component's Element. The value can be a string, a list of strings separated by spaces, or an array of strings. This can be useful for adding customized styles to the component or any of its children using standard CSS rules.
Defaults to: ''
Adding a personal css class you can overwrite css style properties that you're giving using the style config.
If you need to set again these properties you can simply use the component css class again every time you need.
Generate a custom theme for your application or add to the used theme the css.
To create a theme read here: https://docs.sencha.com/extjs/5.1/core_concepts/theming.html
Same on Extjs 6
Example of cls:
my css class uppercase simply set the text to uppercase
{
xtype: 'textfield',
validator: function(value) {
errMsg = "Campo obbligatorio, sostituibile da uno spazio";
return (value !== '') ? true : errMsg;
},
listeners: {
beforerender: 'onTextfieldFocus1',
change: 'onTextfieldChange'
},
anchor: '90%',
fieldLabel: 'Indirizzo',
name: 'Indirizzo',
fieldCls: 'x-form-field uppercase',
enableKeyEvents: true,
enforceMaxLength: true,
maxLength: 50
}
so, to the component base cls x-form-field, i added the css class uppercase, simply extjs while Printing the component html content will assign to that two classes instead of one
In my case i used that css class to set to uppercase all the input fields of a single form, assigning to them the cls class