Rental Widget - Custom Styling
Advanced customization options for developers and designers
Last updated
Advanced customization options for developers and designers
Last updated
If the configuration options of the Product Rentals Pro Rental Widget aren't enough for you to get the Rental Widget looking as you'd like, you can customize it with custom CSS.
There are two ways to do this:
Using the "Custom CSS" box within the theme block configuration options
Applying custom CSS via an external CSS file, targeting the Rental Widget's CSS selectors
Below we break down the main CSS selectors to target, which can then be applied in either of the two ways above.
Element | CSS Selector | Example |
---|---|---|
To apply CSS adjustments to more specific parts of the calendar, or Rental Widget, determine the appropriate CSS selectors via browser Developer Tools. If you aren't a developer and need further guidance, please contact our support team and we'll be happy to assist.
When a customer selects dates in the Rental Widget, an additional CSS class is applied to the Rental Widget container.
The Rental Widget container always has a class of .rw-container
applied to it.
When dates have been selected an additional class gets added of .rw-dates-selected
Below is an example of how you might use this is to make content appear, or become more prominent once dates have been selected.
If you're using the Insurance Add-On feature of Product Rentals Pro, you might realise that by default, it doesn't really stand out much, so customers may not notice it or pay a lot of attention to it. This means potential lost revenue for your business.
This can be helped by changing the appearance with custom CSS. At the same time, you may not want to make your product page look too busy, distracting, or just ugly.
Because an additional class is added to the Rental Widget container once dates have been selected, you can have the insurance option appear plain and simple to begin with (or even have it hidden), but then make it really stand out as soon as the customer has selected dates, so that it's almost impossible to miss before they click the Rent Now button (or whatever you have labelled in the PRP settings.
Before dates have been selected:
After dates have been selected:
Notice that there is a 'shine' effect that appears every few seconds. This might be considered too much to always be there, but is fine to apply only once someone has selected variant options and rental dates. The CSS even injects some extra text into the box ("Protect yourself from accidents for a low fee").
Below is the custom CSS that was applied to achieve the appearance above.
Element | CSS Selector | Example |
---|---|---|
Option
.rw-option
Option Label
.rw-option-label
Option Values
.rw-option-value
Selected Option Values
.rw-option-value.rw-option-value__selected
Text above and below calendar
.rw-datepicker-text
Text above calendar
.rw-datepicker-text__above
As above, but only for the text above the calendar.
Text below calendar
.rw-datepicker-text__below
As above, but only for the text below the calendar.
Recap Selected Date Label
.rw-recap_date-label
Recap Selected Date
.rw-recape_date-text
Recap Price Label
.rw-recap_price-label
Recap Price
.rw-recap_price-text
Add To Cart Button
.rw-cta
Add To Cart Button (disabled state)
.rw-cta[disabled]
Calendar
.rw-calendar
Current Month Label
.rw-calendar_current-month
Current Year Label
.rw-calendar_current-year
Days of the Week
.rw-calendar_day-of-week
Individual Date Cell
.rw-calendar_date-cell
Date Cell (disabled)
.rw-calendar_date-cell.disabled
Date Cell (selected)
.rw-calendar_date-cell.selected
Date Cell (hover)
.rw-calendar_date-cell.hover