I
I
IvanKalinin2017-09-06 03:12:40
WordPress
IvanKalinin, 2017-09-06 03:12:40

How to prevent rewriting the styles of a react application mounted in a normal website (eg Wordpress)?

Hello.
Who can share the experience of using React applications in sites like Wordpress.
Ran into an issue where React app styles overwrite website styles (both have overlapping classes (e.g. normalizations, default colors and/or different Bootstrap settings)
How do you isolate a React app from the rest of the website.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
oh, 2017-09-06
@IvanKalinin

it is most reliable to assign an id to the container in which your react sits and rewrite all the styles for the react starting from this #react_container_id
tails can become longer, but they will not conflict with the main ones in both directions
, usually in css it is better not to use id as selectors, but in In case of integration, this option helps out

N
Negwereth, 2017-09-06
@Negwereth

CSS modules

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question