Next.js Discord

Discord Forum

react shadow

Unanswered
Giant Chinchilla posted this in #help-forum
Open in Discord
Giant ChinchillaOP
Is there any way to leverage shadow in react or next js to encapsulate style of parent...
because i am using inner html how i able to achieve

21 Replies

Giant ChinchillaOP
@alfonsus basically I have user emails and i want to show exactly in innerhtml ...
<div
dangerouslySetInnerHTML={{
__html: content.html,
}}
></div>
where do you want to show the shadow?
Giant ChinchillaOP
Basically this div should render in shadow wherever I use i want div in shadow dom
@Giant Chinchilla <div dangerouslySetInnerHTML={{ __html: content.html, }} ></div>
you want it like this?

<
  dangerouslySetInnerHTML={{
    __html: content.html,
  }}
></>
no div?
or do you want a CSS shadow?
i dont quite get what you meant sorry
Giant ChinchillaOP
Yes I want css shadow ....
@Giant Chinchilla Yes I want css shadow ....
where? on the <div>? or inside the HTML content?
Giant ChinchillaOP
Inside html content
@Giant Chinchilla Inside html content
you can use CSS selectors for that
does the particular element on the inside HTML content have a particular id/classname?
Giant ChinchillaOP
Basically it's email content so Id and class name not permanent....
yes you could still do it with css selectors
using :nth-child
Giant ChinchillaOP
Okay means I will provide some default css to override using css selector rather than shadow dom i will try ....
@Giant Chinchilla Okay means I will provide some default css to override using css selector rather than shadow dom i will try ....
shadow dom sounds complicated especially when you can't know the content for sure ahead of time
Giant ChinchillaOP
@alfonsus Yes I checked some packages but they are hard to replicate in the nextjs . I will try the css way only because the main think effect template is css only....