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-cssfor a few CSS rules, written right into the codedata-css-urlfor 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.
A few rules with data-inline-css
Section titled “A few rules with data-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.
A whole stylesheet with data-css-url
Section titled “A whole stylesheet with data-css-url”<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.
Hide the top bar
Section titled “Hide the top bar”<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.
Good to know
Section titled “Good to know”- Rules in these attributes only apply inside the widget. A rule for
.headerdoesn’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.