Styling the Embedded Operator Widget
Part Theming
Specific parts of the Operators Widget can have their default styles overridden through the ::part pseudo-element.
There are multiple main styling blocks:
- The widget's filtering carousel, these are the parts you can access:
filter__btn-tag: the rounded, selectable filter buttons in the filter carouselfilter__btn-tag--state-selected: the currently selected filter button in the filter carouselfilter__btn-tag__tag-text: the text inside the filter buttonfilter__btn-tag__tag-text--state-selected: the text inside the selected filter buttonfilter__btn-prev: the left arrow button to scroll left through the filter carouselfilter__btn-next: the right arrow button to scroll right through the carouselfilter__gradient-left: the gradient beside the left arrowfilter__gradient-right: the gradient beside the right arrow
- The widget's Card, these are the selectable parts:
card__surface: container which holds the Card's contentscard__hero: container which holds the card's herocard__image-container: container which holds the card's image or placeholder div if no image is foundcard__image: for the card's image or placeholder svg if no image is foundcard__title: text for the Card's titlecard__description: text for the Card's descriptioncard__btn-details: button on bottom left of the Cardcard__btn-book: button on bottom right of the Card if a custom booking link is provided by the Operator
- The widget's details side pane, which has two selectable parts:
details__main: container which holds all Operator information, underneath the image carouseldetails__btn-contact: the three contact buttons for the Operator – website, phone and emaildetails__btn-see-more: the see more button (shown if an operator-details-link template is provided to the widget)details__address-title: the word "Address"details__address-link: the address linkdetails__short-description: the short description textdetails__description: the description textdetails__operating-hours-title: the operating hours titledetails__operating-hours-day: the operating hours days textdetails__operating-hours-hours: the operating hours hours text
- When the widget's
list-display-modeisgrid, these are some parts you can access:widget__btn-load-more: button to load more operators
- When the widget's
list-display-modeisgridand the widget is on mobile it is displayed as a carousel, you can access all the parts of the carousel in this case:- When the widget's
list-display-modeiscarouselthese are the parts you can access: widget__btn-load-more: button to load more operatorswidget__title: text for the widget's titlecarousel__gradient: the gradient that appears on the right side of the carouselcarousel__container: the container of the carousel componentwidget__btn-prev: the left arrow button to scroll left through the operatorswidget__btn-next: the right arrow button to scroll right through the operatorswidget__controls: the container for the left and right arrow buttons
- When the widget's
NOTE If you're using the carousel mode, you can also customize the carousel scrollbar by using the following CSS variables:
whereabouts-operators-widget {
--swiper-scrollbar-display: none;
--swiper-scrollbar-border-radius: 0px;
--swiper-scrollbar-bg-color: blue;
--swiper-scrollbar-drag-bg-color: red;
--swiper-scrollbar-width: 100%;
--swiper-scrollbar-max-width: none;
--swiper-scrollbar-right-position: unset;
--swiper-scrollbar-left-position: 0;
--swiper-scrollbar-height: 12px;
--swiper-scrollbar-drag-height: 6px;
--swiper-scrollbar-padding: 3px;
}
You may define your styles containing these overrides in any manner, but ensure they are present on your embedding website. Our embedding widget is called the whereabouts-operators-widget, so the CSS syntax will be as follows:
whereabouts-operators-widget::part(-part-name-here-) {
background-color: red;
...
}
Global Theming
You may override the default fonts in the widget, by passing in a font-family-override prop to the Operators widget. If you are using an external font, ensure that it is properly loaded on your embedding website.
<whereabouts-operators-widget ... font-family-override="Comic Sans MS" ... ></whereabouts-operators-widget>