File tree Expand file tree Collapse file tree 5 files changed +1742
-1139
lines changed
Expand file tree Collapse file tree 5 files changed +1742
-1139
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,7 @@ const ReactiveBase = {
275275 className = { className }
276276 getSearchParams = { this . getSearchParams }
277277 setSearchParams = { this . setSearchParams }
278+ userThemeProp = { this . $props . theme }
278279 >
279280 { children ( ) }
280281 </ URLParamsProvider >
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const URLParamsProvider = {
1717 getSearchParams : types . func ,
1818 setSearchParams : types . func ,
1919 as : VueTypes . string . def ( 'div' ) ,
20+ userThemeProp : VueTypes . oneOf ( [ VueTypes . bool , VueTypes . object . def ( { } ) ] ) ,
2021 } ,
2122 mounted ( ) {
2223 this . init ( ) ;
@@ -238,7 +239,11 @@ const URLParamsProvider = {
238239 render ( ) {
239240 const children = this . $slots . default ( ) ;
240241 return (
241- < Base as = { this . $props . as } class = { this . $props . className } >
242+ < Base
243+ as = { this . $props . as }
244+ class = { this . $props . className }
245+ userThemeProp = { this . $props . userThemeProp }
246+ >
242247 { children }
243248 </ Base >
244249 ) ;
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ const Base = ({
1313} ;
1414
1515export default styled ( Base ) `
16- font-family: ${ ( { theme } ) =>
17- theme && theme . typography ? theme . typography . fontFamily : 'unset' } ;
18- font-size: ${ ( { theme } ) => ( theme && theme . typography ? theme . typography . fontSize : 'unset' ) } ;
19- color: ${ ( { theme } ) => ( theme && theme . colors ? theme . colors . textColor : 'unset' ) } ;
16+ ${ ( { userThemeProp, theme } ) =>
17+ userThemeProp === false
18+ ? ''
19+ : `font-family: ${ theme && theme . typography ? theme . typography . fontFamily : 'unset' } ;
20+ font-size: ${ theme && theme . typography ? theme . typography . fontSize : 'unset' } ;
21+ color: ${ theme && theme . colors ? theme . colors . textColor : 'unset' } ;` }
2022 width: 100%;
2123
2224 input,
Original file line number Diff line number Diff line change @@ -17,22 +17,7 @@ export const X_SEARCH_CLIENT = 'ReactiveSearch Vue';
1717
1818export const composeThemeObject = ( ownTheme = { } , userThemeParam = { } ) => {
1919 let userTheme = { } ;
20- if ( typeof userThemeParam === 'boolean' && userThemeParam === false ) {
21- userTheme = {
22- typography : {
23- fontFamily : 'inherit' ,
24- fontSize : 'inherit' ,
25- } ,
26- colors : {
27- textColor : 'inherit' ,
28- primaryTextColor : 'inherit' ,
29- primaryColor : 'inherit' ,
30- titleColor : 'inherit' ,
31- alertColor : 'inherit' ,
32- borderColor : 'inherit' ,
33- } ,
34- } ;
35- } else {
20+ if ( typeof userThemeParam !== 'boolean' && Object . keys ( userThemeParam ) . length ) {
3621 userTheme = { ...userThemeParam } ;
3722 }
3823 return {
You can’t perform that action at this time.
0 commit comments