React风格的Componte+ Mui

发布于 2025-02-10 21:49:51 字数 1351 浏览 0 评论 0原文

我正在使用样式组件的GlobalStyle(CreateGlobalStyle)及其正常工作,除非

基本上是为了自定义MUI组件,否则我(从HTML渲染中)

<style data-styled="active" data-styled-version="5.3.5">
    .teste1 :{background-color:red;border:1px solid red !import;}
    .teste2 :{background-color:blue;border:1px solid blue !import;}
</style>
<nav class="drawer">
    <div class="PrivateHiddenCss-root PrivateHiddenCss-xsDown css-1f8mm7w-PrivateHiddenCss-root">
        <div class="MuiDrawer-root MuiDrawer-docked css-7ik032-MuiDrawer-docked" id="Drawer_123">
            <div class="teste1 teste2">teste</div>
            <div class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 teste1 teste2 MuiDrawer-paper MuiDrawer-paperAnchorLeft MuiDrawer-paperAnchorDockedLeft css-12i7wg6-MuiPaper-root-MuiDrawer-paper">

class teste1和teste2 coldect and corret corret corret em em style and corret and corted contection the Mui a the Mui Compents)html html)元素但没有渲染。背景颜色不会在网站中呈现。我在DIV中进行了测试,但也没有工作。那是什么时候渲染此组件的东西?大概在创建样式之前?我怎么能做得更好?

 <Drawer id="Drawer_123" variant='permanent' {...other}
      classes={{
        paper: 'teste1 teste2'
      }}
    >
      <div className="teste1 teste2">teste</div>
      <List id="List_Drawer_123" disablePadding>

I am using GlobalStyle(createGlobalStyle) from Styled-Components and its working fine unless to customize MUI components

Basically, I have (from HTML render)

<style data-styled="active" data-styled-version="5.3.5">
    .teste1 :{background-color:red;border:1px solid red !import;}
    .teste2 :{background-color:blue;border:1px solid blue !import;}
</style>
<nav class="drawer">
    <div class="PrivateHiddenCss-root PrivateHiddenCss-xsDown css-1f8mm7w-PrivateHiddenCss-root">
        <div class="MuiDrawer-root MuiDrawer-docked css-7ik032-MuiDrawer-docked" id="Drawer_123">
            <div class="teste1 teste2">teste</div>
            <div class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 teste1 teste2 MuiDrawer-paper MuiDrawer-paperAnchorLeft MuiDrawer-paperAnchorDockedLeft css-12i7wg6-MuiPaper-root-MuiDrawer-paper">

The class teste1 and teste2 was rendered corretly em STYLE and applied corretly to (indie athe MUI component) HTML element but not rendered. The background colors dont apear in site. I tested in a div and not worked too. Thats anything about when this component is rendered? Probably before the style was created? How I can do this better?

 <Drawer id="Drawer_123" variant='permanent' {...other}
      classes={{
        paper: 'teste1 teste2'
      }}
    >
      <div className="teste1 teste2">teste</div>
      <List id="List_Drawer_123" disablePadding>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文