File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -970,12 +970,16 @@ class Component extends Base {
970970 */
971971 afterSetTheme ( value , oldValue ) {
972972 if ( value || oldValue !== undefined ) {
973- let cls = this . cls ;
973+ let me = this ,
974+ { cls} = me ;
974975
975- NeoArray . remove ( cls , oldValue ) ;
976- value && NeoArray . add ( cls , value ) ;
976+ // We do not need to add a DOM based CSS selector, in case the theme is already inherited
977+ if ( value !== me . parent ?. theme ) {
978+ NeoArray . remove ( cls , oldValue ) ;
979+ value && NeoArray . add ( cls , value ) ;
977980
978- this . cls = cls
981+ me . cls = cls
982+ }
979983 }
980984 }
981985
Original file line number Diff line number Diff line change @@ -216,6 +216,22 @@ class Container extends Component {
216216 }
217217 }
218218
219+ /**
220+ * Triggered after the theme config got changed
221+ * @param {String|null } value
222+ * @param {String|null } oldValue
223+ * @protected
224+ */
225+ afterSetTheme ( value , oldValue ) {
226+ super . afterSetTheme ( value , oldValue ) ;
227+
228+ value && this . items ?. forEach ( item => {
229+ if ( ! Neo . isString ( item ) ) {
230+ item . theme = value
231+ }
232+ } )
233+ }
234+
219235 /**
220236 * Triggered after the windowId config got changed
221237 * @param {Number|null } value
You can’t perform that action at this time.
0 commit comments