Giter Site home page Giter Site logo

Comments (7)

Wildhoney avatar Wildhoney commented on August 19, 2024 2

Inherited styles such as color, font-family etc... are still carried across the shadow boundary.

from reactshadow.

achang97 avatar achang97 commented on August 19, 2024

Is there a good way of resetting these styles? I’m also trying to use Material UI within the shadow dom, which is proving to be a little difficult.

from reactshadow.

Wildhoney avatar Wildhoney commented on August 19, 2024

Yes with all: initial (or revert – not as well supported).

from reactshadow.

Wildhoney avatar Wildhoney commented on August 19, 2024

As an example: https://codesandbox.io/s/react-shadow-4rcso

from reactshadow.

achang97 avatar achang97 commented on August 19, 2024

Thanks - I reset some of the styles using that approach, but with Material UI it’s still inheriting some of external page’s styling.

That is, there are styles such as the font-size (defines in the html tag) which impact the size of fonts of mui, which are defined in rem. I followed the answer provided here: https://stackoverflow.com/questions/51832583/react-components-material-ui-theme-not-scoped-locally-to-shadow-dom, but I’m still having some issues with minor differences across sites.

from reactshadow.

Wildhoney avatar Wildhoney commented on August 19, 2024

Well that's problematic as rem is inherited from the html tag, and the shadow root has no effect on that inheritance.

from reactshadow.

Wildhoney avatar Wildhoney commented on August 19, 2024

I’m going to close the ticket, but please let me know if you need any more help.

from reactshadow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.