2017-10-16 8 views
1

私のアプリでいくつかの設定が必要です。 は、例えば、私は材料-UIからコンポーネントSearchIconを使用して、私は、画面上にそれを調整したい:反応にtheme.breakpointsを組み合わせるには?

style = themes => { 
iconSearch: { 
    [theme.breakpoints.up('sm') && theme.breakpoints.down('md')]: { 
    margin: 14% 
    } 
    [theme.breakpoints.up('md') && theme.breakpoints.down('lg')]: { 
    margin: 8% 
    } 
} 

しかし、これはときmin-width=576pxmax-width=768pxマージン14%を作るために考慮に入れると、第二のためにはありませんオプション。それを修正するには?

答えて

0

これは、だから、両方のソリューションが動作しなければならないMUI Github repo

oliviertassinariで答えました。しかし、これはテストされていないコードであることに注意してください。

style = themes => { 
iconSearch: { 
    [`${theme.breakpoints.up('sm')} and ${theme.breakpoints.down('md')}`]: { 
    margin: 14% 
    } 
} 


style = themes => { 
iconSearch: { 
    [theme.breakpoints.between('sm', 'md')]: { 
    margin: 14% 
    } 
} 
関連する問題