簡體   English   中英

Material UI,React和樣式化一些(而非全部)組件

[英]Material UI, React and styling some, not all, components

我有一個數據表,使用材料UI在React中輸出類似的東西。

<button class="MuiButtonBase-root MuiTab-root MuiTab-textColorPrimary Mui-selected MuiTab-fullWidth" tabindex="0" type="button" role="tab" aria-selected="true">
    <span class="MuiTab-wrapper">ASIC Notification</span>
    <span class="MuiTouchRipple-root"></span>
</button>

Material UI內容的相當標准輸出。 我通過將我的應用程序包裝在此來設置這個素材UI內容的樣式

const theme = createMuiTheme({
    MuiTab: {
        textColorPrimary: {
            color: "white !important" //White tab text color
        },
        '&$selected': {
            color: "#182033 !important" //Dark tab text select color
        }
    }
}

這可以根據需要改變樣式。 但是每當我import MUIDataTable from "mui-datatables";使用MUI Datatable import MUIDataTable from "mui-datatables"; 他們都分享這些課程,我需要設計第二個不同的風格; y。

如何命名表,以便只有該表受某些樣式影響?

謝謝

我想知道同樣的事情,就不同的風格而言,Material UI為大多數組件提供了color道具,可以切換組件的主題樣式,但是沒有明確的文檔說明如何使用自己的主題顏色擴展這些API例如, primary secondary facebook danger你有什么。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM