@@ -961,33 +961,56 @@ export function wordpressThemeJson(config: ThemeJsonConfig = {}): VitePlugin {
961961 settings : {
962962 ...baseThemeJson . settings ,
963963 color : disableTailwindColors
964- ? undefined
964+ ? baseThemeJson . settings ?. color
965965 : {
966966 ...baseThemeJson . settings ?. color ,
967967 palette : [
968968 ...( baseThemeJson . settings ?. color
969969 ?. palette || [ ] ) ,
970970 ...( colorEntries || [ ] ) ,
971- ] ,
971+ ] . filter (
972+ ( entry , index , self ) =>
973+ index ===
974+ self . findIndex (
975+ ( e ) => e . slug === entry . slug
976+ )
977+ ) ,
972978 } ,
973979 typography : {
974980 ...baseThemeJson . settings ?. typography ,
975- defaultFontSizes : false ,
976- customFontSize : false ,
981+ defaultFontSizes :
982+ baseThemeJson . settings ?. typography
983+ ?. defaultFontSizes ?? false ,
984+ customFontSize :
985+ baseThemeJson . settings ?. typography
986+ ?. customFontSize ?? false ,
977987 fontFamilies : disableTailwindFonts
978- ? undefined
988+ ? baseThemeJson . settings ?. typography
989+ ?. fontFamilies
979990 : [
980991 ...( baseThemeJson . settings ?. typography
981992 ?. fontFamilies || [ ] ) ,
982993 ...( fontFamilyEntries || [ ] ) ,
983- ] ,
994+ ] . filter (
995+ ( entry , index , self ) =>
996+ index ===
997+ self . findIndex (
998+ ( e ) => e . slug === entry . slug
999+ )
1000+ ) ,
9841001 fontSizes : disableTailwindFontSizes
985- ? undefined
1002+ ? baseThemeJson . settings ?. typography ?. fontSizes
9861003 : [
9871004 ...( baseThemeJson . settings ?. typography
9881005 ?. fontSizes || [ ] ) ,
9891006 ...( fontSizeEntries || [ ] ) ,
990- ] ,
1007+ ] . filter (
1008+ ( entry , index , self ) =>
1009+ index ===
1010+ self . findIndex (
1011+ ( e ) => e . slug === entry . slug
1012+ )
1013+ ) ,
9911014 } ,
9921015 } ,
9931016 } ;
0 commit comments