In the Widget Editor, you can set the button color, the font and the visible content. To use all the customization options, add your own CSS code to the widget. This article explains how the CSS code is built and shows common adjustments for the Catalog view and the Product view.
Tip: You can test your CSS code on many websites. One of them is: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro
1. How to work with CSS
1.1. Basic structure
- Every CSS code starts with
<template id="product-catalog-widget-styles">. - This tag shows that the code is for the Product and Catalog Widget.
- It also connects the CSS code to the HTML code.
<template id="product-catalog-widget-styles"> <style> </style> </template>
1.2. Write a CSS rule
- Below the first
<style>, enter the term for the element you want to edit. - Put a dot
.in front of the term and an opening curly bracket{after it. - In the next line, enter the property you want to change, e.g.
color, followed by a colon:. - Enter a hex color code or a color name (e.g. green).
- Add a semicolon
;after the color. - Close the rule with a closing curly bracket
}. - Add more CSS rules if needed.
- Close the style block with
</style>. - Close the template with
</template>. - Below the template, add the HTML code from the Regiondo Widget Editor.
Important: Everything in bold must be entered for the code to work. Everything in italic can be changed.
<template id="product-catalog-widget-styles">
<style>
.regiondo-booking-header {
color: #008000;
}
</style>
</template>
2. Add the CSS code to the widget code
For the CSS customization to work, you have to add a snippet to the HTML code from the Widget Editor.
- Create the HTML code in the Widget Editor.
- After
<product-catalog-widget, addstyles-template-id="product-catalog-widget-styles".
Example of HTML code from the Widget Editor:
<product-catalog-widget widget-id="d9c38076-5bbe-43c9-bce3-822500bc7c59"></product-catalog-widget> <script>...</script>
Result:
<product-catalog-widget styles-template-id="product-catalog-widget-styles" widget-id="d9c38076-5bbe-43c9-bce3-822500bc7c59"></product-catalog-widget> <script>...</script>
Complete code with CSS template and widget code:
<template id="product-catalog-widget-styles"> <style>...</style> </template> <product-catalog-widget styles-template-id="product-catalog-widget-styles" widget-id="d9c38076-5bbe-43c9-bce3-822500bc7c59"></product-catalog-widget> <script>...</script>
3. Typical CSS adjustments
The CSS codes in this section cover common customization requests. Some codes change the Catalog view and others change the Product view.
3.1. “Booking” header in the Product view
- This code changes the color of the Booking heading in the Product view.
- It also changes the color of the price information.
- The code uses the color
#0275A4(blue). You can replace it with any hex color code.
.regiondo-booking-header {
color: #0275A4;
}
3.2. Offer title in the Product view
- The term
regiondo-product-headerstands for the heading above the offer image in the Product view. - To change its color, replace the hex color code.
.regiondo-product-header {
color: #0275A4;
}
3.3. Widget background
- You can change the background color, but it should always stay transparent.
- With a transparent background, the widgets fit best into your website.
.regiondo-catalog, .Re-c-MuiOutlinedInput-marginDense, .regiondo-list-product, .regiondo-product-details {
background-color: transparent;
}
3.4. Hide the Regiondo logo in the Catalog view
- This code hides the Regiondo logo in the Catalog view.
.Re-c-MuiButton-label svg {
display:none ;
}Note: If this code doesn’t work because of a dynamic class, contact support@regiondo.com for help.
3.5. “Description”, “More information” and “Venue” headers in the Product view
- This code changes the Product view of the widget.
- You can adjust the background color of the booking widget. It should stay transparent if possible.
- You can change the font color of the Description, More information and Venue headers.
- You can change the color to any hex color code.
.regiondo-widget{background-color: transparent;}
.regiondo-collapsible-header{
color: #0275A4;
}Example: In the screenshot, the hex color code
#0275A4(blue) was changed to#008000(green).
3.6. Offer titles in the Catalog view
- This code changes the color of the offer headers in the Catalog view.
- To change the color, replace the hex color code.
.regiondo-list-product-header{
color: #0275A4;
}Example: In the screenshot, the hex color code
#0275A4(blue) was changed to#008000(green).
4. Other CSS adjustments
4.1. Button hover color in the Catalog view
- This code changes the color of the button hover effect in the Catalog view.
- In this example, the hover color is green. You can also choose the button’s background color. In this example, it’s blue.
Note: A hover effect, also called a mouseover effect, appears when the user moves the mouse over an element, e.g. a button
.regiondo-list-product-button:hover {
background-color: green;
color: blue
}
4.2. Rounded corners on the offer image
- This code changes the corners of the offer image.
- Open an online HTML simulator.
- Add the code below.
- Enter any percentage you like.
- Check the result in the simulator to find the percentage that works for you.
.regiondo-list-product-image {
border-radius: 35% 35% 35% 35% / 35% 35% 35% 35%;
}
4.3. Replace highlights with images
- This code replaces the highlight bullet points in the product description with your logo.
- In the code, replace the link inside
url("...")with the link to your logo.
.regiondo-product-highlights li::before {
content: "";
position: absolute;
background: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGJuXVE0Qvz70hWMErEJRjw_u_Jo6zunyhnXcD64cTwSQ6IblBY-bcD43P5MDVNIsYjlY&usqp=CAU") center no-repeat;
background-size: contain;
width: 25px;
height: 25px;
margin-left: -35px;
margin-top: -5px;
}
Related articles
- How to use the Widget Editor
- How does the integration of the new React Catalog & Product Widget work?