简体   繁体   English

在React应用程序中包含样式

[英]Including styles in React application

I have the javascript code written to be implemented on other sites. 我已编写要在其他网站上实现的javascript代码。 It's like small modal window that is opened for user purposes. 这就像为用户目的打开的小模式窗口。 While developing it i were using semantic ui stylesheets. 在开发它时,我正在使用语义ui样式表。 But now I understood that if user want to add this window to his site, he should also add the styles, to make it look like it was developed and designed. 但是现在我了解到,如果用户想将此窗口添加到他的站点,他还应该添加样式,以使其看起来像是开发和设计的。 But the styles is global, I mean semantic styles. 但是样式是全局的,我的意思是语义样式。 And there two possible situation. 并且有两种可能的情况。 User adds semantic styles and the site is broken, or user didn't use semantic styles and then my window is broken. 用户添加了语义样式,站点被破坏了,或者用户没有使用语义样式,然后窗口被破坏了。 What is the best way for me to solve this problem. 对我来说,解决此问题的最佳方法是什么。 How can I attach semantic styles only to my window? 如何仅将语义样式附加到窗口?

you can use iframe and attach style sheet inside it, It will only effect the Components/Contents inside the Iframe - 您可以使用iframe并在其中附加样式表,这只会影响IframeComponents/Contents -

Check the details in this link - iframe 检查此链接中的详细信息-iframe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM