File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,9 @@ export class JSONEditor {
4343 /* Attempt to locate a shadowRoot parent (i.e. in Web Components) */
4444 const shadowRoot = getShadowParent ( this . element )
4545 addRules ( 'default' , rules , shadowRoot )
46- addRules ( themeName , themeClass . rules , shadowRoot )
46+ if ( typeof themeClass . rules !== 'undefined' ) {
47+ addRules ( themeName , themeClass . rules , shadowRoot )
48+ }
4749 }
4850
4951 /* Init icon class */
Original file line number Diff line number Diff line change @@ -78,6 +78,13 @@ describe('JSONEditor', function () {
7878 expect ( editor . theme ) . toBeTruthy ( )
7979 } )
8080
81+ it ( 'can add custom theme (no custom css rules)' , ( ) => {
82+ class CustomTheme extends JSONEditor . AbstractTheme { }
83+ JSONEditor . defaults . themes . myCustom2 = CustomTheme
84+ editor = new JSONEditor ( element , { schema : schema , theme : 'myCustom2' } )
85+ expect ( editor . theme ) . toBeTruthy ( )
86+ } )
87+
8188 it ( 'can add custom editor' , ( ) => {
8289 class CustomEditor extends JSONEditor . AbstractEditor { }
8390 JSONEditor . defaults . editors . custom = CustomEditor
You can’t perform that action at this time.
0 commit comments