Skip to content

How to customize the forest widget with CSS

The review forest widget draws itself in its own sealed-off part of your page (a Shadow DOM), so the normal CSS of your website doesn’t reach it. To style it anyway, add one of two attributes to the widget’s div in the code from your dashboard:

  • data-inline-css for a few CSS rules, written right into the code
  • data-css-url for a separate CSS file with as many rules as you like

The dashboard doesn’t add these attributes to the code, so you add them yourself. In the examples, replace xxxyyyxxx with the ID of your widget, the part after reviewforest-app- in your code.

Inline CSS
<div
class="reviewforest-app-xxxyyyxxx"
data-inline-css=".promo__ttl { color: #ff69b4; font-weight: bold; }"
></div>

This makes the headline at the top of the widget bold and pink. The forest name in it keeps its green color.

External CSS file
<div
class="reviewforest-app-xxxyyyxxx"
data-css-url="https://www.your-business.com/css/reviewforest.css"
></div>

The widget loads the file and applies its rules. If the file is on a different domain than your website, the server it’s on has to allow your website to load it (CORS).

You can also use both attributes on the same div. If both set the same property, the rule from the file wins, because the widget adds it last.

<div
class="reviewforest-app-xxxyyyxxx"
data-inline-css=".header { display: none; }"
></div>

This hides the bar at the top of the widget with the ReviewForest logo, the menu and the language switcher.

  • Rules in these attributes only apply inside the widget. A rule for .header doesn’t touch the header of your own website.
  • To find more class names, right-click the widget on your website and choose Inspect. The developer tools show the widget’s elements under #shadow-root.
  • Carousels that still run on version 1.0 accept the same two attributes. After an upgrade to V2, use the color settings or CSS variables instead.