Resources

Products

Playbook: Self-service portal customisation

Modified on: Mon, 23 Nov, 2026 at 5:34 PM

TABLE OF CONTENTS

Overview

This practical guide details how to restyle the self-service portal using custom CSS. It explains page-specific targeting, separate and unified styling for web browsers versus the mobile app, techniques for ensuring CSS override precedence, and key practices to avoid. Additionally, the ‘Customise placeholders in templates’ section addresses styling template placeholders, while the ‘Use custom scripts in customisation templates’ section details how to incorporate your own custom scripts into them.


Navigation path for customising: Admin > Portals > [Select Portal] > Customise > Custom Stylesheet


Important:

  • The examples provided throughout this playbook serve as illustrative patterns rather than turn-key code. Each selector, color, size, and script featured here is intended solely to demonstrate effective targeting methods and override techniques. Because exact selectors vary based on your specific portal setup, pages, and components, you should identify them directly by inspecting target elements in DevTools across both browser and mobile environments (refer to the ‘Specify CSS and ensure your override prevails’ section for guidance). Treat these snippets as structural blueprints: replace placeholder selectors and values with your own, then validate your updates thoroughly (refer to the ‘Test with checklist’ section). Directly copying sample code without adaptation may produce no visible effect or unintentionally alter unintended components.


  • Understanding "mobile customisation": The portal can be accessed either through a standard web browser (on desktop or mobile devices) or directly within the mobile app. When accessed via the app, portal pages are overlaid with a mobile-optimized UI layer featuring a bottom navigation bar, a back button with page title (replacing breadcrumbs), bottom sheets (replacing native dropdowns), snackbars for concise alerts, and a "load more" control instead of standard pagination. Additionally, portal headers and footers are omitted on most app screens. Mobile customisation refers to applying custom CSS to restyle this app interface, either independently or in conjunction with the desktop browser layout. Since there is no dedicated mobile stylesheet, all styling is managed within the main Custom Stylesheet. To target app-specific elements, prefix your CSS selectors with body[data-client="mobile-app"], an attribute applied strictly when the portal operates inside the app (for details, refer to the ‘Choose view: Browser, mobile app, and both’ section). Components exclusive to the mobile application environment are documented in the ‘Components for mobile app’ section. Note that viewing the portal in a narrow mobile web browser is distinct from the mobile app environment; consequently, using @media (max-width: 767px) alone will not isolate the app.


1. How your CSS is applied

The portal displays in one of two modes using a single stylesheet:


View 

When 

How to recognise it in the page

Browser view

Accessing the portal via a mobile or desktop web browser

<body> has no data-client attribute

Mobile-app view

Accessing the portal through the mobile app

<body data-client="mobile-app">


A single Custom Stylesheet field applies your styles universally across both views.


Your custom CSS is queued last in the loading sequence. The portal compiles the stylesheet for each view in the following order:

  • Browser view: portal base styles > YOUR CSS

  • Mobile-app view: portal base styles > portal mobile-app styles > YOUR CSS


Since your CSS is applied last, matching our selector's exact specificity ensures your rules take precedence—there is no need to create higher-specificity selectors (refer to the ‘Specify CSS and ensure your override prevails’ section).


Ensure you write standard CSS, as the stylesheet undergoes validation upon saving; any stylesheet failing validation will be rejected. Refer to the following rules:


Allowed 

Not allowed (save fails)

Plain CSS rules, media queries, @font-face, @keyframes

Sass variables such as $blue ("Undefined variable")

Nested rules (.a { .b { … } &:hover { … } })

Sass mixins and @include

var(--…) custom properties 

min() / max() mixing units, for example min(100%, 400px)

calc(), clamp(), env() 

:is() and :where()

:not(…), :has(…), attribute selectors 

Space-separated colour syntax such as rgb(0 0 0 / 50%). Use rgba(0, 0, 0,  0.5) instead.

Logical properties (margin-inline-start, inset-inline-end)



Improper placement of CSS: Avoid adding a <style> tag within the Head template. Because it gets processed prior to the portal stylesheet, it will be overridden in every specificity conflict. Always apply styles within the Custom Stylesheet instead.


2. Choose view: Browser, mobile app, and both

To structure your styles, begin each CSS rule using one of the following prefix patterns:


/* Mobile app only. Prefix specificity (0,1,1) */ 

body[data-client="mobile-app"] .your-target { color: #0b6e4f; }


/* Browser only. Prefix specificity (0,1,1); :not() counts as its argument */ 

body:not([data-client="mobile-app"]) .your-target { color: #0b6e4f; }


/* Both views. No prefix */ 

.your-target { color: #0b6e4f; }


You  

want

Use 

Watch out for

Mobile  

app only

body[data-client="mobile-app"] …

Mobile-app rules frequently use deep selector hierarchies. Be sure to match their full selector chain (refer to the ‘Specify CSS and ensure your override prevails’ section).

Browser  

only

body:not([data-client="mobile-app"]) …

No additional configuration needed—the rule simply will not match within the application.

Both views 

no prefix 

The mobile app might define a more specific rule for the target element. In such cases, provide a selector list covering both specificity levels (see sample G2 section).


Note that @media query rules do not uniquely represent "the mobile app". The portal’s responsive layout adjusts at 767px for phones and 1203px for tablets, and the mobile app interface matches the 767px query as well. Consequently, any CSS rule within @media (max-width: 767px) affects:

  • Mobile web browsers

  • Resized or narrow desktop windows

  • The native mobile app


To target the mobile app specifically, rely on body[data-client="mobile-app"]. To scope rules exclusively to narrow web browsers, combine the media query with the negation attribute:


@media (max-width: 767px) {

 body:not([data-client="mobile-app"]) .your-target { padding: 8px; }

}


Additional <body> attribute markers available for targeting:


Marker 

Present when

body[page="…"] 

Always present. Identifies the active page using values defined in the ‘Customise pages’ section. This attribute is assigned by the page script immediately following load.

body.keyboard-user 

Apply this marker to style focus states when keyboard navigation is active.

body[data-freddy-home="true"] 

The Freddy search layout is active on the home page.

body.side-modal-open 

Indicates an active side panel, such as announcements or "Place request".

body.modal-open 

A modal dialog is currently active.

body.fs-drawer-open 

Mobile application view: a bottom sheet overlay is currently active.

html[dir="rtl"] 

This marker appears when the portal is rendered in a right-to-left language.


3. Specify CSS and ensure your override prevails

CSS specificity is calculated using a three-part score—(IDs, classes/attributes/pseudo-classes, element types)—evaluated strictly left to right. A single ID selector overrides any quantity of class selectors, while one class selector takes precedence over any number of element selectors.


Part of a selector

Counts as

#id

1 in the first column

.class, [attribute], :hover, :focus, :not(.x) (counts as its argument)

1 in the second column

div, span, li, ::before

1 in the third column


Examples: 

  • body[data-client="mobile-app"] is (0,1,1)

  • body[data-client="mobile-app"][page="ticket_list"] #sec-ticket-list .page-body ul#ul-ticket-list li a span. status.active is (2,5,5)


Key strategies to guarantee your CSS overrides take effect:

  1. Duplicate the original selector. Because your custom stylesheet is loaded after the portal styles, matching the exact selector creates a tie that your rules will win. Locate and copy the portal rule’s selector directly using browser developer tools; while adding extra qualifiers is allowed, matching the existing selector is sufficient.

  2. Match !important declarations. When overriding a property declared with !important, your custom rule must also include !important while maintaining equal or greater specificity. Standard rules without !important cannot override those that use it.

  3. Leverage ID shortcuts for lengthy rules. For highly specific or long portal selectors, incorporating an ID selector simplifies your rule—a single ID outranks any number of class selectors. For example, #page-main serves as a consistent ID across all pages. This technique is also used by the portal itself; refer to the M4 sample section for a demonstration.


Where the portal itself uses !important

Since the majority of portal CSS rules omit !important, simply matching the existing selector is generally sufficient for overrides. However, the portal explicitly applies !important in the specific scenarios listed below, requiring your custom rules to use !important as well:


Where 

What is forced 

Why

Mobile app: form fields (text, email, number, textarea, native select, date and time, lookup)

border, radius, background, font size, height, margin, padding; focus ring; error border

To override standard page-specific field rules and the global focus ring

Mobile app: reply button on the ticket page (#send-reply),  "Place request" confirm button (#confirm-request)

background, colour, border, including the disabled state

To uphold uniform branding, a single accent colour overrides default button styling.

Mobile app: text editor toolbars (ticket reply, new ticket, catalog item, journey forms)

toolbar hidden 

Otherwise, the editor's native script causes them to display

Mobile app: ticket page header 

position, size 

Positioning and dimensions are managed by an automated script that applies inline styling directly to the header.

Mobile app: filter "pills" on list pages (shape, border, padding) 

border, padding, width 

This styling is shared with the onboarding list page, which pulls in additional legacy stylesheets.

Browser: focus ring on text inputs 

border colour, shadow 

Accessibility


Note: The following two worked examples are provided strictly for demonstration. The specific CSS selectors and calculated specificity values apply exclusively to the elements shown. When styling a different component, inspect its actual selector via DevTools and follow the same logic. Avoid reusing these sample selectors unless you are targeting these exact elements.


Worked example A: mobile ticket list status pill 

In DevTools, the pill shows this portal rule (no !important):

body[data-client="mobile-app"][page='ticket_list'] #sec-ticket-list .page-body ul#ul-ticket-list li a span.status.active { 

 color: var(--color-text-semantic-warning); 

 background-color: var(--color-fill-semantic-warning-mildest); 

 border: 1px solid var(--color-boundary-semantic-warning-mild); 

}


Loses (0,3,2 is less than 2,5,5): 

body[data-client="mobile-app"] span.status.active { background-color: #ffe9d6; } 

Wins (same selector, so yours loads last and wins the tie). See sample M1 section.


Worked example B: catalog item title, browser vs app 

The browser rule for the title is about (4,3,0). The mobile-app rule is: body[data-client="mobile-app"][page='catalog_items'] #catalog-list-page #catalog-list-container #catalog-list-items #list-items .catalog-item .catalog-item-info .item-name, which is (4,5,1).


Consequently, a concise selector like #catalog-list-page #list-items .catalog-item .item-name (2,2,0) suffices for properties untouched by the mobile application. However, it gets overridden in the app for attributes like color, font-size, font-weight, and line-height. Refer to Section G3 for an example of resolving this via a selector list.


4. Customise portal-wide

4.1 Start with Colours and Fonts, then use variables 

Begin by defining brand colors and typography in Customize Colors & Fonts. These settings are exposed as CSS custom properties attached to :root, which are consumed by most portal styling rules across both desktop and mobile views:


Variable 

Used for

--bg_color 

Page background

--header_color 

Header bar background

--footer_color 

Footer background

--textColor 

Body text

--headingsColor 

h1 and h2

--secondaryColor 

Labels, icons, secondary text

--linkColor, --linkColorHover 

Controls primary hyperlinks as well as key brand accent elements, including active tabs/pills in the mobile interface, "load more" navigation links, and active focus state outlines within rich-text editors.

--nav_background, --nav_active, -- nav_hover

Side navigation menu

--baseFont, --headingsFont, --secondaryFont

Font stacks


Since your custom stylesheet is loaded last in the cascade, any variables you redefine within it will take precedence: 

:root { 

 --linkColor: #0b6e4f; 

 --linkColorHover: #084c36; 

} 


Important: Header icons (such as menu and notifications) and side-navigation text toggle between light and dark variants according to the header and navigation colors configured in Colours & Fonts. Because this setting is applied during stylesheet compilation, manually overriding --header_color within CSS alters the bar's background color without updating the corresponding icon variant. To ensure consistency, update header and navigation colors directly in Colours & Fonts rather than via CSS.


To maintain visual alignment with the portal's standard color scheme, leverage the design system's built-in --color-… tokens using var(). Examples of these tokens include --color-text-primary, --color-text-secondary, --color-fill-surface, --color-fill-brand, --color-boundary-border-mild, --color-text-semantic-warning, and --color-fill-semantic-success-mildest. Refrain from redefining these custom properties globally, as they are globally shared across all components.


4.2 Elements present on every page


Element 

Selector 

Notes

Header bar 

header#header-main 

Mobile app: hidden on every page except Home

Header inner row 

#header-container


Portal logo 

header .portal-logo 

Max height 32px by default

Portal name 

header .portal-name


Side navigation 

header nav#main-nav, links nav#main-nav a, current page a.active 

Accessed via the "More" option in the bottom navigation bar within the mobile app

Main content area 

main#page-main 

Acts as the root container for all page-level content

Footer 

footer#footer-main 

Mobile app: hidden on every page

Breadcrumbs  

(browser)

.breadcrumbs-container, links .breadcrumbs-link, current . breadcrumbs-link-header


Buttons 

.btn, .btn.btn-primary, .btn.btn-secondary, .link-btn


Tabs 

.tabs-list .btn.btn-tab


Notifications  

(toasts)

#toast-container .toast 

Web browser view (refer to section B5). Note that the mobile app utilizes a snackbar component instead (refer to section M6)

Dialogs 

#fs-modal, with .modal-header, .modal-body, .modal-footer


Side panel 

#side-modal.side-modal, content #side-modal-content 

Outside #page-main

Banners 

#message-banner (preview, "viewing as", delegation) 

Mobile app: hidden


5. Customise pages

The body[page="…"] attribute identifies the active page. Use it to restrict page-specific rules to their scope, beginning with the root container of the page.


Page 

body[page=…] 

Root container 

Mobile-app notes

Home 

portal_home 

#home-page-container 

Displays the header (overlaying the hero transparently) alongside bottom navigation controls

Search 

search 

#search-layout-container #search-overlay .search-container

Appears as a sliding bottom sheet

Ticket list 

ticket_list 

#sec-ticket-list 

The header remains hidden, filters are styled as pills, and bottom navigation is included

Ticket details 

ticket_view 

.ticket-show-container 

Header hidden

New ticket 

submit_ticket 

#ticket-new-main 

Omits the main header alongside both the title section and Cancel action.

Service  

catalog

catalog_items 

#catalog-list-page 

Category navigation renders as pills, with bottom navigation active

Catalog item 

catalog_item 

#service-request-container 

"Place request" opens a full-height side panel

Journeys 

journeys 

#journey-configs-list-page 

Type list becomes a pill

Start a  

journey

journey_config 

#journey-request-initiator-form 

Cancel hidden

Journey  

request

journey_request_show 

#journey-details-page 

Tabs become pills

Journey task 

journey_plain_task 

#journey-plain-task-page 

Cancel hidden

Journey form  task

journey_form_activity 

#journey-form-activity


My journey  

requests

journey_requests_list 

#sec-journey-requests-list 

Pills; bottom nav

Action items 

action_items 

#action-item-list 

Tabs become pills

Pending  

approvals

pending_approvals 

#sec-approval-list


Changes 

change_list 

#sec-change-list 

Pills; bottom nav

Post-incident  reports

post_incident_reports_list / post_inci dent_report_show

#sec-post-incident-reports-list / .pir-show-container

List has bottom nav

Solutions  

home

solutions_home 

.solutions-home-container 

Category list becomes a pill; bottom nav

Solutions  

folder

article_list 

.folder-view-container


Article 

article_view 

.articles-container 

Print button hidden

Profile 

profile_edit 

.profile_edit (enhanced layout: body.enhanced-layout, .profile_edit_v2)


Login 

user_login 

.login-page


Sign up 

user_signup / user_signup_complete 

.signup-container / .signup-complete-container


Password  

reset

user_password_reset 

.password-reset


Freddy 

freddy_agent 

#freddy-page 

Opens as a bottom sheet

Not found /  

error

not_found / internal_server_error 

.not-found-page / .internal-server-error-page



Classic-layout pages 

A subset of portal pages retains the classic layout architecture while integrating the refreshed visual theme on top:


Page 

body[page=…] 

Root container

New change 

change_create 

#create-change

Change details 

change_view 

#change-show

Onboarding / offboarding list 

employee_onboarding / offboarding 

#employee-onboarding-container

New onboarding / offboarding request 

employee_onboarding_new / offboarding_new

#employee-onboarding-new / #employee-offboarding-new

Onboarding / offboarding request (awaiting  information)

employee_onboarding_view / offboarding_view

#onboarding-awaiting-info-wrapper


Key guidelines for classic pages:

  • Always structure selectors around the root container. Avoid depending on body[page=…] because it is assigned late by the page script, whereas root IDs are available immediately.

  • The main#page-main element is absent on these views.

  • Because an additional classic stylesheet is loaded after yours, selector ties will resolve in its favor. Include a supplementary class or ID from the page in your selector to guarantee higher specificity.


6. Customise components on each page

The CSS hooks detailed below correspond to the classes and IDs discoverable via DevTools. Elements available in both environments are labeled "Both", whereas those limited to a specific layout are marked as "App" or "Browser".


Important note: Use these tables as a guide to locate key elements and standard hooks rather than a ready-to-use list of selectors. Target selectors will vary based on the specific page and element being modified. Building a complete CSS rule typically requires additional scoping (such as the page prefix referenced in ‘Select container and keep styles contained’ or extended selector chains to override longer default portal rules). Always verify your selectors in DevTools to ensure accuracy prior to deployment.


Home (portal_home, #home-page-container)


Component 

Selector 

View

Hero banner 

#hero-banner, heading .hero-banner-container > h2 

Both

Hero search box 

#global-search-home 

Both

Announcement banner 

#announcement-banner (browser), #announcement-banner-mobile with .announcement-mobile-card (app)

Separate

Action cards 

#cards-banner .card, .card h3, .card p, .card img 

Both

Lists (tickets, changes,  

onboarding, offboarding,  journeys)

#home-lists-container #ticket-list-container ul li (also #change-list-container, #on board-list-container, #offboard-list-container, #journey-list-container)

Both

Status pills in lists 

… li span.status, .status.active, .status.past 

Both

List tabs 

#home-lists-container .tabs-list .btn.btn-tab 

Both


Ticket list (ticket_list, #sec-ticket-list), Changes (#sec-change-list), Journey requests (#sec-journey-requests-list)


Note: The Ticket list, Changes, and Journey requests sections share an identical structural format.


Component 

Selector 

View

Filter, sort and department controls

.page-header, #ticket-filter, .sort-by-container, .department-filter-container

Both (pills in app)

Row or card 

ul#ul-ticket-list li, link li a, title li a h3, meta li a p 

Both (cards in app)

Status pill 

li a span.status; open .active; closed .past (browser); resolved .status-4 and closed . status-5 (app)

Both

Pagination or "load more" 

ul.pagination-links (browser), .fs-lazy-list__more (app) 

Separate


Ticket details (ticket_view, .ticket-show-container)


Component 

Selector 

View

Header, subject, info 

.ticket-show-header, .ticket-subject, .ticket-main-info 

Both

Age or status pill 

.ticket-age 

Both

Conversation cards 

.ticket-detail-card, .note-detail-card, agent replies .agent-response

Both

Reply box 

.ticket-add-reply, 
editor .froala-container, 
send button #send-reply

Both (#send-reply is !important in the app)

Side panel (fields, CSAT, approvals)

.ticket-show-right-pane, #ticket-fields-update, #survey-details

Browser

Actions menu 

#ticket-ops-mobile 

App


New ticket (submit_ticket, #ticket-new-main)


Component 

Selector 

View

Title row 

.ticket-new-header, .ticket-new-title-row 

Browser (hidden in app)

Form body and fields 

#ticket-new-body, fieldset.ticket-field, .control-element, .control-label 

Both

Requester and CC 

.default_requester, #cc-container 

Both

Suggested articles 

aside.suggested-articles 

Both

Submit 

.btn-container #btn-submit 

Both


Service catalog (catalog_items, #catalog-list-page), Catalog item (catalog_item, #service-request-container)


Component 

Selector 

View

Catalog header 

#catalog-list-header, #catalog-title 

Browser (hidden in app)

Category list 

#catalog-list-categories #categories-list li a 

Browser

Category pill 

.categories-list-section #categories-list-select, .fs-select-drawer-trigger

App

Item cards 

#list-items .catalog-item, .catalog-item-image img, .item-name, .item short-description, .item-cost

Both

Item details 

.service-item-details, .service-item-name, .service-price-container 

Both

Bundles 

.bundle-container .bundle-item 

Both

Place request  

button

.place-request-footer .place-request-btn 

Both

"Place request"  side panel

#side-modal .place-request-container, .quantity-cost-container,  confirm #confirm-request

Both (#confirm-request is !important in the app)


Journeys


Component 

Selector 

View

Journey catalogue  cards

#journey-configs-list-page #list-items .config-item, .config-item-info 

Both

Type filter 

#journey-types (browser), .journey-types-list-section .fs-select-drawer-trigger (app) 

Separate

Request header and  tabs

#journey-details-header, #journey-details-tabs .journey-details-tabs-item.active 

Both

Activities 

#journey-activities-list .config-item 

Both

Task and form pages 

#journey-plain-task-page, #journey-form-activity, 

footers footer .btn-primary, .activity form-footer .btn

Both


Solutions and articles


Component 

Selector 

View

Solutions header 

.solutions-home-header 

Both (simplified in  app)

Category list 

.solutions-category-link (browser), #solutions-category-list-mobile (app pill) 

Separate

Article and folder cards 

.solutions-content-list-item, .solutions-folder-list-item 

Both

Folder page 

.folder-view-container, .articles-list-header-container, .list > li a. folder-list-item

Both

Article body 

.articles-detail-title, .articles-detail-description (h2, p, table, img, blockquote)

Both

Feedback ("Was this helpful?")

#articles-options 

Both

Related articles 

.articles-related-container 

Both


Action items, approvals, login, sign-up, profile


Component 

Selector

Action item tabs and rows

#action-item-list .action-item-tabs-item(.active), ul.action-item-list-container li

Approval rows 

#sec-approval-list ul.approval_list-container li

Login panels 

.login-page div.login-section, 

agent side .agent-login, 

requester side .requestor-login, 

artwork . illustration-container

Sign-up form 

.signup-container #signup-form

Profile 

.profile_edit .user-info-card, #profile-fields, .profile-edit-footer #profile-submit


7. Components for mobile app only

These elements are exclusive to the mobile app environment. Because several of them attach directly to <body> rather than sitting within #page-main, any CSS selector prefixed with #page-main or a specific page container will fail to target them.


Component 

Selector 

Where  

in the  

page

Notes

Bottom  

navigation

#bottom-nav-mobile, 

tab .bottom-nav-item, 

current .bottom-nav-item.active, 

icon .bottom-nav-icon, 

label .bottom-nav-label

<body> 

Shown on home, ticket list, solutions, catalog, changes, post-incident reports and journey requests

Back button and page title

.breadcrumbs-container--mobile, .breadcrumbs-back-btn, .breadcrumbs link-header

Inside the  page

Replaces browser breadcrumbs

Bottom sheet  

(dropdowns,  

menus, CC)

.fs-drawer (backdrop), .fs-drawer__sheet, .fs-drawer__grabber, .fs drawer__header, .fs-drawer__title, .fs-drawer__close, .fs-drawer__body,  .fs-drawer__footer

<body>


Options in a  

sheet

.fs-drawer-search__input, .fs-drawer-option, .fs-drawer-option.is selected, .fs-drawer-option__label, .fs-drawer-option__tick

<body>


Dropdown  

trigger

.fs-select-drawer-trigger 

In the  

form

Replaces native <select>

Snackbar 

.fs-mobile-snackbar, 

shown with .is-visible, 

hiding with .is-leaving 

<body> 

Short confirmation and error messages; see sample M6 section

"Load more" row 

.fs-lazy-list, .fs-lazy-list__more 

Below  

lists

Replaces page numbers

Home  

announcements row

#announcement-banner-mobile .announcement-mobile-card 

Home


Search and  

Freddy sheets

#search-layout-container #search-overlay .search-container, #freddy-page

<body>



8. Select container and keep styles contained

To prevent style conflicts, always target CSS rules to the narrowest parent container encompassing your target element. Restricting rule scope prevents modifications on one page from inadvertently affecting elements with shared class names—such as .status, .card, or .btn—on separate pages.


Note: The selectors listed below (such as ticket_list, #sec-ticket-list, and #home-page-container) are provided solely as illustrative examples to show how to structure a contained selector for different scopes. They are not intended for direct use. You must determine the exact selectors for the specific pages and components you intend to target:


  1. Find the target page's body[page="…"] attribute and corresponding root container in the ‘Customise pages’ section.

  2. Inspect the element you wish to modify using DevTools on that page to identify its component container along with its associated classes or IDs.

  3. Construct your custom selector by combining the appropriate scope prefix for your use case (for example, single page or single view) with the target container and element, then verify in DevTools that it accurately targets only the intended element.


Be sure to swap out sample names like ticket_list and #sec-ticket-list with your actual page and container identifiers.


Scope 

Prefix

Whole portal, both views 

body or no prefix (only for variables, typography and .btn themes)

Whole portal, one view 

body[data-client="mobile-app"] / body:not([data-client="mobile-app"])

One page, both views 

body[page="ticket_list"] #sec-ticket-list

One page, mobile app 

body[data-client="mobile-app"][page="ticket_list"] #sec-ticket-list

One page, browser 

body:not([data-client="mobile-app"])[page="ticket_list"] #sec-ticket-list

One component  

everywhere it appears

the component's root, for example #home-page-container #cards-banner .card

Mobile bottom sheets and  snackbar

body[data-client="mobile-app"] .fs-drawer__sheet, body[data-client="mobile-app"] .fs mobile-snackbar (never under #page-main)

Side panels 

#side-modal (outside #page-main)

Classic-layout pages 

the page's root id, for example #create-change, #employee-onboarding-new


9. Check anti-patterns

The anti-patterns below are categorized by scope: rules applicable across all views, followed by guidelines specific to the mobile application and web browser environments respectively.


9.1 Both views


Don't 

Why 

Do instead

Unscoped element selectors: div {}, l i {}, input {}, span {}

These broadly impact all pages, including dialogs, bottom sheets, and rich text editors. 

Scope to a page or component root.

* { … } rules 

Disrupts icon rendering, rich text editor functionality, and focus ring visibility throughout the portal.

Target the component.

!important by default, or on every declaration "to be safe" (see the ‘When to use !important’ section below)

Using !important unnecessarily is counterproductive when overriding standard portal rules, as it unnecessarily complicates future overrides. Furthermore, it risks breaking interactive, state-based styling—such as hover, focus, disabled, and error conditions—by continuously overriding them.

Only include !important on declarations explicitly flagged with !important by the portal, ensuring your selector matches the target (refer to the ‘Specify CSS and ensure your override prevails’ section).

Styling by position: li:nth-child(3),  > div > div

Breaks when content or order changes. 

Use the class or id.

Sass variables, mixins, min()/max()with mixed units, :is()/:where()

The save check rejects them. 

Plain CSS; use width: 100%;  max-width: 400px; instead of min()

Wrapping your rules in @layer 

Regardless of specificity, CSS rules defined inside an @layer are always superseded by unlayered portal rules.

Leave rules unlayered.

<style> in the Head template 

It is evaluated before portal CSS, causing it to lose specificity conflicts. 

Custom Stylesheet

Relying on data-show-for=" 

mobile_app" in your own HTML to  hide content in the browser

That attribute is hidden in browser view only for the portal's native breadcrumb elements.

Add the browser-hide rule (see sample G4 section)

Overriding a form field's border-color without also styling :focus

Your custom rule overrides the focus ring styling. 

Restate :focus (see sample M4 section)

Targeting utility toggles: .hide, .show on-mobile, .hide-on-mobile, .is open, .active on their own

Dynamic script updates override static definitions, creating conflicts with internal page logic. 

Combine with the component class

Selectors on generated ids or long numeric ids

These identifiers fluctuate across releases or individual records. 

Use the documented ids and classes

Defining or relying on --Color-… names (capitalised)

This variable is not included in the standard portal variable set and is subject to change. 

Use the --color-… tokens and theme variables from ‘Customise portal-wide’ section


9.2 Mobile app only


Don't 

Why 

Do instead

@media (max-width: 767px)to mean "the app" 

Applies to mobile web browsers and resized or narrow viewports as well 

body[data-client="mobile-app"]

Changing position, display, or transform on .fs drawer, .fs-drawer__sheet, or .fs-mobile snackbar

To verify that its styles are fully loaded, the application monitors these properties. If any modifications occur, it defaults to standard dropdown menus and toast notifications.

Change colours, radius, padding, and fonts only (see sample M6 section)

Re-showing controls the app hides (Cancel buttons, duplicate titles, the header on inner pages)

Built-in back and close controls are included natively within the application

Leave them hidden

Input or editor text below 16px in the app 

Focusing fields with font sizes smaller than 16px triggers automatic page zooming on iOS devices

Keep 16px or larger

Styling the bottom sheets, snackbar, bottom navigation or side panels from a selector that starts at #page-main or a  page container

Because these elements sit outside #page-main or attach directly to <body>, using that container in your selector prevents matches entirely (refer to the ‘Components for mobile app’ section).

Start from body[data-client=" mobile-app"] (or #side-modal for side panels)


9.3 Browser only


Don't 

Why 

Do instead

Writing a browser-only rule with no prefix 

Without a prefix, the rule is applied to the mobile app environment as well

body:not([data-client="mobile-app"]) … (see ‘Choose view: Browser, mobile app, and both’ section)

Changing transform, opacity, animation, or transition on .toast, width or animation on .toast-progress, or position or z-index on #toast-container

These properties handle the slide-in, slide-out, and countdown animations. Modifying them causes the toast notification to remain hidden or get frozen on screen

Change colours, radius, shadow, and fonts only  

(see sample B5 section)

A fixed width on .toast outside a desktop-only media query 

This additionally supersedes the portal's default mobile width constraints

Put it in @media (min width: 768px) (see sample B5 section)


9.4 When to use !important

Because most portal rules do not specify !important, simply matching the portal’s selector is sufficient to override them, as your custom stylesheet loads last and wins specificity ties (refer to the ‘Specify CSS and ensure your override prevails’ section). Introducing !important unnecessarily offers no benefit and creates distinct issues:


  • Restricts self-overriding: Once applied, overriding your own styling requires adding !important to subsequent rules (such as hover or error states) alongside higher specificity, causing rapid style escalation.

  • Disables interactive states: Default styles using border-color: red !important override state pseudo-classes (like :focus, :hover, disabled, or error conditions) unless those state rules also declare !important, stripping visual cues such as focus rings or validation borders.

  • Creates cascading dependency: Using !important on a single property forces subsequent rules targeting the same element to use it as well.


Apply !important strictly when overriding portal declarations that explicitly include it. Regardless of selector specificity, standard rules omitting !important cannot supersede declarations that utilize it. Scenarios where the portal mandates !important are detailed in the ‘Specify CSS and ensure your override prevails’ section—including mobile-app form fields, reply and "Place request" confirmation controls, editor toolbars, the ticket header, list filter pills, and browser text input focus rings.


Follow this step-by-step process to evaluate each declaration individually:

  1. Locate the portal rule for the property you wish to modify by inspecting the element using DevTools.

  2. Should the declaration include !important, match or increase selector strength and apply !important exclusively to that specific declaration.

  3. Omit !important if it is not present in the original rule. If the override fails to take effect, resolve the issue by reviewing selector specificity (refer to the ‘Specify CSS and ensure your override prevails’ section) instead of introducing !important.

  4. When adding !important, redefine state-specific rules (including :hover, :focus, error, and disabled) to preserve interactive functionality (refer to sample M4 section). 


/* The portal sets border-radius with !important on this field, so yours needs it too */ body[data-client="mobile-app"] #page-main .control-element textarea { 

 border-radius: 12px !important; /* only the declaration that needs it */ 

 color: #1a1a1a; /* the portal does not force text colour, so no !important */ } 


The code snippet above serves purely as an example. Prior to using this pattern, verify in DevTools if your target property explicitly requires the !important declaration on your specific page.


10. Use sample snippets

Every sample details its applicable scope, the specific portal rule it overrides along with that rule's specificity score, and the resulting behavior in alternative views.


Note:

The provided code snippets are intended to illustrate styling techniques rather than function as copy-and-paste solutions. Each snippet targets a specific element using example attributes—such as #0b6e4f or 12px—and should be adapted to your requirements. Before implementing any modifications:


  • Identify the precise selector for your target element using DevTools (refer to the ‘Specify CSS and ensure your override prevails’ section); 

  • Apply the structural pattern from the snippet—including prefix usage, selector lists, and !important declarations—to your custom selector; 

  • Substitute sample values with your organization's specific brand colors, fonts, and dimensions; 

  • Verify your updates across both web browser and mobile app environments (consult the ‘Test with checklist’ section).


The "Overrides" metadata specifies the target portal rule corresponding to each code sample. Because portal rules may evolve across release cycles, always inspect DevTools to verify the current selector before relying on these references.


Mobile app only

M1. Ticket list: "open" status pill colour 

  • Overrides: body[data-client="mobile-app"][page='ticket_list'] #sec-ticket-list .page-body ul#ul-ticket-list  li a span.status.active, (2,5,5), no !important. 

  • Wins because: the selector is identical and your loads last.

  • Browser: unchanged.


body[data-client="mobile-app"][page="ticket_list"] #sec-ticket-list .page-body ul#ul-ticket-list li a span.status. active { 

 color: #7a2e00; 

 background-color: #ffe9d6; 

 border: 1px solid #f5b98a; 

}


The same pattern works for changes ([page="change_list"] #page-main #sec-change-list … ul#ul-change-list li a span.status. active) and journey requests ([page="journey_requests_list"] #sec-journey-requests-list … ul#ul-journey-requests-list li  a span.status.active).


M1 b. Ticket page: reply button colour (a place where !important is required) 

  • Overrides: body[data-client="mobile-app"][page='ticket_view'] .ticket-show-container .ticket-add-reply.ticket detail-card #ticket-reply-actions #send-reply.btn.btn-primary, (2,7,1), with !important. 

  • Wins because: same selector and !important.


body[data-client="mobile-app"][page="ticket_view"] .ticket-show-container .ticket-add-reply.ticket-detail-card  #ticket-reply-actions #send-reply.btn.btn-primary { 

 background: #0b6e4f !important; 

 color: #ffffff !important; 

}


To guarantee that the button continues to appear inactive prior to text entry, the portal maintains a distinct grey disabled state with a higher specificity score of (2,8,1).


M2. Bottom navigation: active tab colour 

  • Overrides: body[data-client="mobile-app"] #bottom-nav-mobile .bottom-nav-item.active, (1,3,1).


body[data-client="mobile-app"] #bottom-nav-mobile .bottom-nav-item.active { 

 color: var(--linkColor); 

} 


M3. Bottom sheets: corner radius and title 

  • Overrides: .fs-drawer__sheet and .fs-drawer__title, (0,1,0). The search sheet is styled separately by body[data-client="mobile-app"] #search-layout-container #search-overlay .search-container, (2,2,1). 

  • Scope from body: sheets live outside #page-main.


body[data-client="mobile-app"] .fs-drawer__sheet { 

 border-radius: 12px 12px 0 0; 

} 

body[data-client="mobile-app"] .fs-drawer__title { 

 font-size: 18px; 

} 

body[data-client="mobile-app"] #search-layout-container #search-overlay .search-container {  border-radius: 12px 12px 0 0; 

} 


M4. Form text fields: rounder corners and a brand focus ring 

  • Overrides: body[data-client="mobile-app"] .control-element input:not(…), which excludes 12 field types and so is (0,14,2), with !important on border, radius, background and font size. Its focus state is (0,15,2), also !important. 

  • Wins because: one id (#page-main) outranks any number of classes, and !important matches ours. 

  • Side panels such as "Place request" are outside #page-main, so the selector list includes #side-modal. 

  • Keep font-size at 16px or above.


body[data-client="mobile-app"] #page-main .control-element input[type="text"]:not(.date):not(.search-select), body[data-client="mobile-app"] #page-main .control-element input[type="email"], 

body[data-client="mobile-app"] #page-main .control-element textarea, 

body[data-client="mobile-app"] #side-modal .control-element input[type="text"]:not(.date):not(.search-select), body[data-client="mobile-app"] #side-modal .control-element textarea { 

 border-radius: 12px !important; 

} 

body[data-client="mobile-app"] #page-main .control-element input[type="text"]:not(.date):not(.search-select): focus, 

body[data-client="mobile-app"] #page-main .control-element input[type="email"]:focus, 

body[data-client="mobile-app"] #page-main .control-element textarea:focus, 

body[data-client="mobile-app"] #side-modal .control-element input[type="text"]:not(.date):not(.search-select): focus, 

body[data-client="mobile-app"] #side-modal .control-element textarea:focus { 

 border-color: var(--linkColor) !important; 

 box-shadow: 0 0 0 1px var(--linkColor) !important; 

} 


Note: Modifying the default border-color will also override the portal's standard red error outline (.error-group …). If you update the resting border color, ensure you define a matching .error-group rule to preserve error styling.


M5. Mobile page title (back-button row)

  • Overrides: body[data-client="mobile-app"] .breadcrumbs-container--mobile[data-show-for="mobile_app"] . breadcrumbs-link-header, (0,4,1).


body[data-client="mobile-app"] .breadcrumbs-container--mobile[data-show-for="mobile_app"] .breadcrumbs-link header { 

 font-size: 18px; 

 color: var(--headingsColor); 

} 


On the ticket details page, the title's size and weight come from a stronger rule, body[data-client="mobile-app"][page='ticket_view'] . ticket-show-container .ticket-show-header .ticket-show-operations .breadcrumbs-container ol .breadcrumbs-link header (0,7,2). Add that selector to the list if you want the same size there.


M6. Snackbar (confirmation and error messages at the bottom of the screen) 

The app shows short messages, such as "Ticket created" or an error, in a single snackbar attached to <body>:


<div class="fs-mobile-snackbar is-visible" role="status" aria-live="assertive">Ticket created</div>


  • Overrides: .fs-mobile-snackbar, (0,1,0). Its defaults are a dark blue background, white 16px semibold text, 8px corners, 16px padding, and a position 32px above the bottom of the screen. 

  • Wins because: (0,2,1) is higher. Scope from body, because the snackbar lives outside #page-main. 

  • Browser: unchanged. The browser shows its own toast (#toast-container .toast) instead.


body[data-client="mobile-app"] .fs-mobile-snackbar { 

 background-color: #0b6e4f; 

 color: #ffffff; 

 border-radius: 12px; 

 font-size: 16px; 

 font-weight: 500; 

 box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); 

} 


Because the bottom navigation bar has a height of roughly 64px, the snackbar will overlap it by default. To prevent this overlap and keep the snackbar clearly elevated on pages where bottom navigation is displayed, adjust only the bottom property:


body[data-client="mobile-app"][page="portal_home"] .fs-mobile-snackbar, 

body[data-client="mobile-app"][page="ticket_list"] .fs-mobile-snackbar, 

body[data-client="mobile-app"][page="solutions_home"] .fs-mobile-snackbar, 

body[data-client="mobile-app"][page="catalog_items"] .fs-mobile-snackbar, 

body[data-client="mobile-app"][page="change_list"] .fs-mobile-snackbar, 

body[data-client="mobile-app"][page="post_incident_reports_list"] .fs-mobile-snackbar, 

body[data-client="mobile-app"][page="journey_requests_list"] .fs-mobile-snackbar { 

 bottom: calc(80px + env(safe-area-inset-bottom, 0px)); 

} 


Maintain these original settings without modification:


Property 

Why

position 

To determine if its stylesheet is fully loaded, the application verifies position:fixed on this element. Modifying this property causes all notifications to revert to the default toast display.

transform, opacity, vis ibility

These properties control the slide-in and slide-out animations (.is-visible, .is-leaving). Modifying or overriding them will cause the snackbar to remain permanently stuck on screen or fail to appear entirely.

z-index 

It must remain positioned above both the bottom navigation bar and any bottom sheet overlays.


Because success and error notifications share the exact same element and lack distinct type classes, styling them separately is not possible.


Browser only 

B1. Ticket list: "open" status pill colour 

  • Overrides: ul#ul-ticket-list li span.status.active, (1,2,3). 

  • Wins because: (1,3,4) is higher. 

  • App: the selector does not match, so the app keeps its own pill.


body:not([data-client="mobile-app"]) ul#ul-ticket-list li span.status.active { 

 background-color: #ffe9d6; 

 border-color: #f5b98a; 

}


B2. Header: hide the helpdesk phone number 

body:not([data-client="mobile-app"]) header#header-main .helpdesk-number { 

 display: none; 

} 


B3. Home: shorter hero banner on desktop 

  • Overrides: #home-page-container #hero-banner (2,0,0) and [data-ce-version] section#hero-banner (1,1,1), both min height: 372px. 

  • Wins because: (2,1,1) is higher.


body:not([data-client="mobile-app"]) #home-page-container #hero-banner { 

 min-height: 280px; 

} 


B4. Login: replace the artwork 

body:not([data-client="mobile-app"])[page="user_login"] .login-page .illustration-container {  background-image: url("https://example.com/assets/login-art.svg"); 

} 


B5. Toast notifications (messages in the top-right corner) 

The browser shows success, error, warning, and info messages as toasts inside #toast-container:


<section id="toast-container" class="toast-top-right"> 

 <div class="toast active"> 

 <div class="toast-progress toast-success-progress"></div> <!-- countdown bar, when shown -->  <div class="toast-body toast-success ficon-toast-success"> <!-- the icon is .toast-body::before -->  <div id="toast-message" class="toast-message">Your request has been submitted</div>  <button class="toast-close-button">×</button> 

 </div> 

 </div> 

</section>


The message type is on .toast-body: .toast-success, .toast-error, .toast-warning, or .toast-info. The countdown bar uses the matching .toast-success-progress, .toast-error-progress, and so on.


Part 

Portal rule 

Specificity 

Default

Card 

#toast-container .toast 

(1,1,0) 

White, 350px wide, 4px corners, shadow

Card at phone width 

body #toast-container .toast (inside max-width: 767px) 

(1,1,1) 

Full width, at most 300px

Message text 

#toast-container .toast .toast-body .toast-message 

(1,3,0) 

14px, var(--textColor), white background

Icon colour, per type 

#toast-container .toast .toast-body.toast-success:before 

(1,3,1) 

Green, red, orange or blue

Countdown bar, per  type

#toast-container .toast .toast-progress.toast-success progress

(1,3,0) 

Same colours

Position 

.toast-top-right 

(0,1,0) 

12px from the top and the right


  • Scope: browser only. In the mobile app, success and error messages appear in the snackbar instead (see sample M6 section). 

  • Wins because: the browser prefix adds (0,1,1) to each portal selector, so every rule below is stronger.


Card shape and text:

body:not([data-client="mobile-app"]) #toast-container .toast { 

 border-radius: 8px; 

 box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); 

} 

body:not([data-client="mobile-app"]) #toast-container .toast .toast-body .toast-message {  font-size: 15px; 

 font-weight: 500; 

}


/* A fixed width belongs in a desktop-only query; otherwise it also overrides the phone-width rule */ @media (min-width: 768px) { 

 body:not([data-client="mobile-app"]) #toast-container .toast { 

 width: 400px; 

 } 

}


Colours per message type (icon and countdown bar):

/* Success */ 

body:not([data-client="mobile-app"]) #toast-container .toast .toast-body.toast-success:before {  color: #0b6e4f; 

} 

body:not([data-client="mobile-app"]) #toast-container .toast .toast-progress.toast-success-progress {  background: #0b6e4f; 

}


/* Error */ 

body:not([data-client="mobile-app"]) #toast-container .toast .toast-body.toast-error:before {  color: #b42318; 

} 

body:not([data-client="mobile-app"]) #toast-container .toast .toast-progress.toast-error-progress {  background: #b42318; 

}


Apply .toast-warning / .toast-warning-progress as well as .toast-info / .toast-info-progress following the identical approach.


To implement a dark toast theme, style both the toast card and its message area simultaneously, as the message container defaults to a white background: 

body:not([data-client="mobile-app"]) #toast-container .toast, 

body:not([data-client="mobile-app"]) #toast-container .toast .toast-body .toast-message {  background-color: #12344d; 

 color: #ffffff; 

} 

body:not([data-client="mobile-app"]) #toast-container .toast .toast-close-button { 

 color: #ffffff; 

}


Move toasts to the bottom-right corner: 

body:not([data-client="mobile-app"]) #toast-container.toast-top-right { 

 top: auto; 

 bottom: 24px; 

}


Retain the following settings without modification:


Property 

Why

transform, opacity, animation, transition on . toast

These settings handle the entry (slide-in) and exit (slide-out) transitions. The toast remains hidden until the animation for .active is triggered.

width, animation on .toast-progress 

The bar contracts from 100% down to 0% to indicate the remaining time prior to toast closure.

position, z-index on #toast-container 

These properties maintain toast notifications in a fixed position on screen, positioned above both the header and modal dialogs.


Both views

G1. Brand colours and heading font 

  • Overrides: the theme values on :root. Your loads last. 

  • Effect: links, accents, active tabs and pills, and headings in both views.


:root { 

 --linkColor: #0b6e4f; 

 --linkColorHover: #084c36; 

 --headingsFont: "Inter", Helvetica, Arial, sans-serif; 

} 


G2. Primary buttons 

  • Overrides: browser .btn.btn-primary (0,2,0) and .btn.btn-primary:hover (0,3,0); app body[data-client="mobile-app"] .btn. btn-primary (0,3,1).

  • Why a selector list: .btn.btn-primary alone changes only the browser, because the app's rule is stronger.


.btn.btn-primary, 

.btn.btn-primary:hover, 

body[data-client="mobile-app"] .btn.btn-primary { 

 background: #0b6e4f; 

 border-color: #0b6e4f; 

 color: #ffffff; 

}


Buttons requiring dedicated rules:

  • Ticket reply button and "Place request" confirm button (#confirm-request): The mobile app forces their styling using !important (refer to sample M1b).

  • Header "New request" button (#btn-header-request): Inherits primary button styling on desktop, but transitions to an icon button governed by a higher-specificity rule on mobile screens (body header #btn-header-request.btn).

  • Enhanced profile page (body.enhanced-layout[page="profile_edit"]): Buttons are governed by page-specific styling definitions.


G3. Catalog item title 

  • Overrides: browser about (4,3,0); app body[data-client="mobile-app"][page='catalog_items'] #catalog-list-page  #catalog-list-container #catalog-list-items #list-items .catalog-item .catalog-item-info .item-name, (4,5,1).


body #catalog-list-page #catalog-list-container #catalog-list-items #list-items .catalog-item .catalog-item-info . item-name, 

body[data-client="mobile-app"][page="catalog_items"] #catalog-list-page #catalog-list-container #catalog-list-items #list-items .catalog-item .catalog-item-info .item-name { 

 color: #0b6e4f; 

 font-weight: 600; 

}


G4. Your own HTML block, shown in one view only 

When adding custom markup to page templates with the data-show-for attribute, ensure you manually include a rule to hide elements in the web browser. Because the mobile app automatically overrides and enforces display: block, any alternative display types must be reinstated using a rule with higher specificity.


<div class="promo-strip" data-show-for="mobile_app">…</div> 

<div class="promo-banner" data-show-for="browser">…</div> 

body:not([data-client="mobile-app"]) [data-show-for="mobile_app"] { 

 display: none; 

} 

body[data-client="mobile-app"] .promo-strip[data-show-for="mobile_app"] { 

 display: flex; 

}


The [data-show-for="browser"] attribute automatically hides content within the app environment.


G5. Home action cards 

  • Overrides: browser #home-page-container #cards-banner .card (2,1,0); app body[data-client="mobile-app"] #home-page container #cards-banner .card (2,2,1).


#home-page-container #cards-banner .card, 

body[data-client="mobile-app"] #home-page-container #cards-banner .card { 

 border-radius: 12px; 

 border: 1px solid var(--color-boundary-border-mild); 

 box-shadow: none; 

}


G6. Article typography

  • Overrides: .articles-detail-description h2, (0,1,1). The app does not restyle article content.


body[page="article_view"] .articles-detail-description h2 { 

 font-family: var(--headingsFont); 

 font-size: 22px; 

 color: var(--headingsColor); 

} 

body[page="article_view"] .articles-detail-description p { 

 line-height: 1.6; 

}


G7. Right-to-left-safe spacing 

Logical properties flip automatically in right-to-left languages:


#home-page-container #cards-banner .card img { 

 margin-inline-end: 16px; 

}


11. Customise placeholders in templates

Placeholders—represented as variables wrapped in double curly braces like {{user_info.full_name}}—can be included within customisation templates, including Header, Footer, Layout, and specific page templates (for timing and execution details, refer to the ‘Where a script can go, and when it runs’ section). Upon page rendering, the portal dynamically substitutes each placeholder with its corresponding dynamic value. The following guidelines explain how to apply custom CSS styling to these rendered values.


Note: The CSS snippets, placeholder names, and HTML class identifiers shown below serve as conceptual examples. They illustrate the core technique: enclosing a template placeholder within a custom HTML tag to enable targeted styling. Rather than copying these examples directly, select placeholders, CSS properties, and class names tailored to your template structure and design requirements.


11.1 What a placeholder gives you 

Because placeholders are substituted strictly with plain text without any surrounding HTML container, they do not possess native classes or identifiers. Consequently, they inherit the styling of their parent element and cannot be styled directly with CSS.


As an illustration, consider adding the following snippet to the head of the New Ticket template:


<section id="ticket-new-main"> 

{{user_info.full_name}} 

{{user_info.email}} 

{{portal.name}} 

 <div class="ticket-new-header"> 

 … 


On the live portal, these three unstyled values render on a single line right above the breadcrumb navigation:


Jane Doe jane.doe@example.com Acme Support 


Without dedicated styling, spacing, or visual hierarchy, these values simply appear concatenated in the page's standard typeface.


Common placeholders available within the portal's standard templates feature {{user_info.full_name}}, {{user_info.first_name}}, {{user_info.last_name}}, {{user_info.email}}, {{portal.name}}, and {{portal.contact_info}}. See Customise layout and portal pages to review the complete reference. Because placeholder support varies by layout, inspect the dynamic tags integrated into each template's default setup to verify compatibility.


11.2 Wrap the placeholder in your own element 

Enclose each placeholder within a custom HTML element using a distinct class or ID. Once the portal populates the placeholder text, your custom element provides the target required for styling:


<section id="ticket-new-main"> 

 <div class="my-welcome"> 

 <span class="my-welcome-name">{{user_info.full_name}}</span> 

 <span class="my-welcome-email">{{user_info.email}}</span> 

 <span class="my-welcome-portal">{{portal.name}}</span> 

 </div> 

 <div class="ticket-new-header"> 

 … 


  • Assign a unique custom prefix (such as my-welcome-…) to prevent naming conflicts with standard portal elements.

  • Opt for classes over IDs, reserving ID attributes strictly for elements that appear only once per page.

  • Apply <span> tags for inline text modifications, and use <div> tags to wrap block content or structure layouts.

  • Preserve all native portal markup (such as <div class="ticket-new-header">) in its original form.

  • Avoid attempting to enclose internal elements when styling template-inserted portal components like {{> breadcrumbs …}} or {{> ticket_new_form}}. Instead, rely on the designated selectors outlined in the ‘Customise pages’ and ‘Components for mobile app’ sections.


11.3 Style it in the Custom Stylesheet 

Apply your styles directly within the Custom Stylesheet, following standard practices (refer to the ‘How your CSS is applied’ section). Select the appropriate prefix based on your targeted environment from the ‘Choose view: Browser, mobile app, and both’ section, and contain your CSS selector within the page's top-level container (refer to the ‘Select container and keep styles contained’ section). In this context, the root element is #ticket-new-main.


/* Both views: no view prefix */ 

#ticket-new-main .my-welcome { 

 display: flex; 

 flex-wrap: wrap; 

 gap: 4px 12px; 

 margin-bottom: 16px; 

} 

#ticket-new-main .my-welcome-name { 

 font-weight: 600; 

 color: var(--headingsColor); 

} 

#ticket-new-main .my-welcome-email { 

 color: var(--secondaryColor); 

}


/* Browser only */ 

body:not([data-client="mobile-app"]) #ticket-new-main .my-welcome-portal { 

 text-transform: uppercase; 

 letter-spacing: 0.04em; 

}


/* Mobile app only */ 

body[data-client="mobile-app"] #ticket-new-main .my-welcome { 

 flex-direction: column; 

} 

body[data-client="mobile-app"] #ticket-new-main .my-welcome-email { 

 display: none; 

}


Because there are no pre-existing portal styles targeting your custom classes, there are no baseline rules to override. Your CSS only needs to match the target element. Additionally, by scoping these rules to #ticket-new-main, you ensure that no other pages are impacted.


11.4 Things to know


Point 

Why

Placeholder variables are evaluated and substituted exclusively within the Header, Footer, Layout, and individual page templates.

Because the Head template is not evaluated as a dynamic template, placeholders inserted there remain raw text (refer to the ‘Where a script can go, and when it runs’ section).

Avoid embedding {{ expressions directly within a <script> block. 

Because template placeholders undergo replacement prior to script execution (refer to the ‘Rules for scripts’ section), avoid embedding {{ expressions directly in your JavaScript. To retrieve a placeholder value within a script, extract the text content from its wrapper element, such as document.querySelector('.my-welcome-name').textContent.

When a placeholder contains no value, it displays as empty text.

Even if a placeholder lacks content, its wrapping element persists along with any applied margins or padding. To prevent layout gaps, hide empty elements using .my-welcome-name:empty { display: none; }.

Verify performance across web browsers, the mobile application, and unauthenticated public pages.

Since a single template powers both the browser and mobile app experiences, dynamic placeholders (like a user's name) may remain empty for guest or unauthenticated users.

Ensure modified elements maintain strong legibility 

Ensure text remains legible by avoiding low-contrast text colors against the background, and maintain a minimum text size of 16px across mobile app form pages (refer to the ‘9.2 Mobile app only’ section).


12. Use custom scripts in customisation templates

Customisation templates support full HTML, including <script> tags, alongside the Custom Stylesheet. You can locate these templates under Admin > Portals > [Select Portal] > Customise. Path locations follow the structure /a/portals/<portal id>/customise/<template> (such as …/customise/header or …/customise/new-ticket). Note that account-level scripting permissions are required to use custom scripts.


12.1 Where a script can go, and when it runs 

Because the portal operates as a single-page application, navigating between pages re-renders the active page area rather than triggering a full browser refresh. This behavior directly dictates script execution frequency:


Template (path) 

Runs 

Notes

Head (head) 

Executes once per full page load, preceding both <body> creation and the execution of native portal scripts

Because the portal functions as a single-page application, navigating across pages refreshes the active content area rather than performing a full page reload. This architecture directly governs script timing and execution frequency.


Since {{ is not evaluated as a template placeholder here, it can be safely included. This is the optimal location for portal-wide code.

Header (header), Footer (footer), Layout (layout) 

Following the execution of native portal scripts, running once with each complete page load

This also applies to pages using the classic layout (refer to the ‘Customise pages’ section).

Page templates: Home (portal-home), Sign up (user-signup), Search (search-layout, search-results), Solutions (solutions-home, solution-category, articles-list, article-view), Tickets (new-ticket, tickets-list, ticket-details), Approvals (pending-approvals)

Executes on every page rendering—triggering per portal visit and potentially twice per session (initial loading state followed by final content display).

Ensure your code can execute multiple times safely.

Announcements (announcements-home, announcement-view) 

Never 

Because these elements load inside a side panel, embedded scripts will not execute. To handle them, utilize the PageUpdate event within the Head template.


Note that scripts embedded in Head or page templates will not execute on pages utilizing the classic layout structure (specifically: new change, change details, onboarding, and offboarding).


12.2 Telling the browser and the mobile app apart 

Differentiate between the browser and mobile app using the portal's internal flag or the CSS marker:


Check 

Available 

Use for

document.body.getAttribute('data-client') === 'mobile-app'

Once <body> is present: header, footer, layout, page templates, and Head scripts following DOMContentLoaded

Matches your CSS selectors exactly

window.PORTAL && PORTAL. 

is_mobile_app

Once native portal scripts finish loading, the DOMContentLoaded event makes Head code accessible, alongside page templates, layout, header, and footer configurations.

The portal's own mobile-app flag


Both approaches yield identical results. Use the following code patterns depending on your target view:


var isMobileApp = !!(window.PORTAL && PORTAL.is_mobile_app);


// Mobile app only 

if (isMobileApp) { /* … */ }


// Browser only 

if (!isMobileApp) { /* … */ }


// Both: no check, or branch only where the behaviour differs


Because neither parameter is available immediately within the Head template, wait for the DOM content to finish loading before evaluating the page context:


document.addEventListener('DOMContentLoaded', function () { 

 var isMobileApp = document.body.getAttribute('data-client') === 'mobile-app'; 

 // … 

});


12.3 Reacting to page changes 

To track content updates dynamically, rely on the portal’s two standard jQuery events emitted on the document object. Because native addEventListener calls cannot detect them, attach your event handlers using jQuery(document).on(…).


Event 

Fires

PageChange 

When the visitor moves to another page. body[page]already holds the new page name.

PageUpdate 

After a page has rendered its content, and again whenever a list loads more results.


Because dynamically loaded content—including search results, ticket rows, and form fields—is not present when page-template scripts execute, you must wait for the PageUpdate event before attempting to access or modify these elements.


12.4 Rules for scripts


Rule 

Why

Wrap your code in a function: (function () { … })(); 

Keeps your variables from clashing with the portal's

Make it safe to run twice: check for your own marker before adding anything 

Page templates run again on each visit, and sometimes twice per visit

Attach document listeners once: put them in the Head template, or use a namespace with .off() first: jQuery(document).off('PageUpdate.myPortal').on('PageUpdate.myPortal',  fn)

A listener added in a page template is added again on every visit

In Header, Footer, Layout and page templates, never write {{ in your script. Use \{{ if you need the characters.

These templates are processed as Handlebars templates; {{ … }} is replaced before your script runs

Only reach for elements written in the same template, or wait for PageUpdate 

The rest of the page may not exist yet

Use the documented ids and classes (see ‘Customise pages’, ‘Customise components on each page’, and ‘Components for mobile app’ sections) 

Generated ids change

Don't use document.write, and don't replace #page-main, #header-main or #bottom-nav mobile

The portal renders into them

Load external scripts only from domains your account's security policy allows 

A blocked domain fails silently in the browser console

Test in the browser and in the app 

The same template runs in both


12.5 Sample scripts 

Note: These code samples demonstrate key architectural patterns and are not intended for direct copy-pasting. Elements such as IDs, classes, text strings, URLs, and analytics functions serve as dynamic placeholders. You should locate the exact elements on your pages using DevTools, tailor the code accordingly, and follow the guidelines in the ‘Rules for scripts’ section (such as implementing one-time event listeners and execution checks). Always test your modified scripts thoroughly in both browser and mobile environments before going live.


J1. Both views: track page views (Head template) 

<script> 

 document.addEventListener('DOMContentLoaded', function () { 

 jQuery(document).on('PageChange.myPortal', function () { 

 var page = document.body.getAttribute('page'); 

 var view = PORTAL.is_mobile_app ? 'mobile-app' : 'browser'; 

 // Replace with your analytics call 

 console.log('Portal page view:', page, view); 

 }); 

 }); 

</script> 


J2. Browser only: support hours in the header (Header template) 

Add this at the end of the Header template, after the existing markup:


<script> 

 (function () { 

 if (window.PORTAL && PORTAL.is_mobile_app) { return; } 

 var header = document.getElementById('header-container'); 

 if (!header || header.querySelector('.support-hours')) { return; } 

 var note = document.createElement('span'); 

 note.className = 'support-hours'; 

 note.textContent = 'Support: Mon–Fri, 9am–6pm'; 

 header.appendChild(note); 

 })(); 

</script>


Style it with body:not([data-client="mobile-app"]) #header-container .support-hours { … }. 


J3. Mobile app only: a tip at the top of the new-ticket form (New ticket template) 

<script> 

 (function () { 

 if (!(window.PORTAL && PORTAL.is_mobile_app)) { return; } 

 var form = document.getElementById('ticket-new-main'); 

 if (!form || form.querySelector('.app-ticket-tip')) { return; } 

 var tip = document.createElement('p'); 

 tip.className = 'app-ticket-tip'; 

 tip.textContent = 'Tip: attach a screenshot so we can help you faster.'; 

 form.insertBefore(tip, form.firstChild); 

 })(); 

</script> 


J4. Both views, different behaviour: a help link under every article (Article view template) 

Because the article page loads in two stages—initial placeholder loading followed by content rendering—the script delays execution until the main article body is fully present in the DOM.


<script> 

 (function () { 

 var article = document.querySelector('.articles-container .articles-detail-description');  if (!article || article.parentNode.querySelector('.article-help-link')) { return; }  var link = document.createElement('a'); 

 link.className = 'article-help-link'; 

 link.href = '/support/tickets/new'; 

 link.textContent = 'Still need help? Raise a ticket'; 

 if (!(window.PORTAL && PORTAL.is_mobile_app)) { 

 link.target = '_blank'; 

 link.rel = 'noopener'; 

 } 

 article.parentNode.insertBefore(link, article.nextSibling); 

 })(); 

</script>


The link launches in a new tab within web browsers, whereas it opens inline within the mobile application.


J5. Both views: act on content that loads later (Head template) 

Additional ticket rows are populated following the initial rendering of the Ticket list template, with further rows loading as the user scrolls or requests more content. Each of these load events triggers the PageUpdate event.


<script> 

 document.addEventListener('DOMContentLoaded', function () { 

 jQuery(document).off('PageUpdate.myPortal').on('PageUpdate.myPortal', function () {  if (document.body.getAttribute('page') !== 'ticket_list') { return; } 

 var rows = document.querySelectorAll('#ul-ticket-list > li:not([data-my-portal])');  Array.prototype.forEach.call(rows, function (row) { 

 row.setAttribute('data-my-portal', 'seen'); 

 if (row.querySelector('span.status.active')) { 

 row.classList.add('my-open-ticket'); 

 } 

 }); 

 }); 

 }); 

</script>


Style the new class per view with the CSS prefixes in ‘Choose view: Browser, mobile app, and both’ section, for example body[data-client="mobile-app"] #ul-ticket-list li.my-open ticket { … }. 


13. Test with checklist

  1. Stylesheet validation: Verify that the stylesheet saves successfully. Any save failure indicates unsupported syntax (refer to the ‘How your CSS is applied’ section).

  2. Desktop browser view: Review each targeted page on a desktop display.

  3. Mobile browser view: Inspect targeted pages in DevTools device mode (at widths of 767px or narrower) to confirm responsive layout adjustments.

  4. Mobile app view: Launch the portal inside the mobile app to test the same pages. Keep in mind that the app automatically hides inner-page headers and suppresses footers globally.

  5. Interactive & UI states: Test hover states, keyboard navigation focus (via Tab key), disabled button styling, field validation errors (for example, submitting empty required fields), open bottom sheets, side panel overlays, and snackbar alerts (for example, following a ticket submission).

  6. Right-to-left (RTL) support: If an RTL language is supported, validate at least one page in that localization.

  7. DevTools rule precedence: Select the target element and examine the Styles pane; strikethrough declarations represent overridden rules, while the topmost active rule prevails. Use the Computed tab to trace which rule supplies specific properties. If a custom rule is overridden, compare its specificity against the active rule and verify whether !important is required (refer to the ‘Specify CSS and ensure your override prevails’ section).

  8. Custom script verification: Open the browser console and navigate back and forth across multiple pages. Ensure there are no runtime console errors and that injected elements append only once per session rather than re-rendering on every page transition. Re-verify this behavior inside the mobile app environment.


Frequently asked questions (FAQs)

1. Where should I add custom JavaScript snippets to modify the portal, and which variable controls home page cards?

Place all custom JavaScript snippets in the layout footer section (Portal Customisation > Portal Layout > Footer). To modify the content or structure of cards displayed on the portal home page, use the CARDS (and ALL_CARDS) JavaScript variables.

2. How do I add new cards to the portal home page?

Use ALL_CARDS.concat() to append new card objects—defining each card's url, img, title, and content—to the CARDS array:

<script>

CARDS = ALL_CARDS.concat([

  {

    url: '/support/solutions/12',

    img: '/images/portal_v2/solutions.svg',

    title: 'Registration Process',

    content: 'Article about how to register'

  },

  {

    url: '/support/solutions/13',

    img: '/images/portal_v2/solutions.svg',

    title: 'Deletion Process',

    content: 'Article about how to delete your account'

  },

  {

    url: '/support/solutions/14',

    img: '/images/portal_v2/solutions.svg',

    title: 'Approval Process',

    content: 'Article about how to get approval for your registration request'

  }

]);

</script>


3. How do I remove existing cards from the portal home page?


Define an array of card URLs you want to hide (removeCardsUrl) and filter ALL_CARDS so matching URLs are excluded from CARDS:

<script>

var removeCardsUrl = ['/support/solutions', '/support/catalog/items'];


CARDS = ALL_CARDS.filter(function(card) {

  return removeCardsUrl.indexOf(card.url) < 0;

});

</script>


4. How can I rename or update the text and icon of an existing home page card?


Iterate through CARDS using .map(), match the target card by its url, and overwrite its title, content, and img properties:

<script>

CARDS.map(function(card) {

  if (card.url == '/support/tickets/new') {

    card.title = 'Custom New Ticket Title';

    card.content = 'Custom New Ticket Sub Text';

    card.img = 'https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';

  }

  if (card.url == '/support/catalog/items') {

    card.title = 'Custom Service Catalog Title';

    card.content = 'Custom Service Catalog Sub Text';

    card.img = 'https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';

  }

});

</script>


5. How do I update home page card content across multiple languages?


Create a language mapping object (strCardContent) keyed by locale codes (such as 'en' or 'es') and card URLs, then detect the user's active language with I18n.currentLocale() to dynamically update title and content:

<script>

// Add Mapping for languages

var strCardContent = {};


// Adding content for English using url

strCardContent['en'] = {

  '/support/tickets/new': {

    title: 'new ticket title in english',

    content: 'new ticket sub text in english'

  },

  '/support/catalog/items': {

    title: 'catalog item in english',

    content: 'catalog item sub text in english'

  }

};


// Adding content for Spanish using url

strCardContent['es'] = {

  '/support/tickets/new': {

    title: 'nuevo título del boleto en español',

    content: 'subtexto del nuevo ticket en español'

  },

  '/support/catalog/items': {

    title: 'artículo del catálogo en español',

    content: 'subtexto del artículo del catálogo en español'

  }

};


// Setting the current language content for the end user

var currentLocaleContent = strCardContent[I18n.currentLocale()];


CARDS.map(function(card) {

  if (currentLocaleContent[card.url] !== undefined) {

    card.title = currentLocaleContent[card.url].title;

    card.content = currentLocaleContent[card.url].content;

  }

});

</script>


6. How do I reorder cards on the portal home page?


Map each card URL to a numeric position in urlOrderMap, assign card.order, and sort CARDS. If you are both adding new cards and reordering them, place this script after the card addition script:

<script>

var urlOrderMap = {

  '/support/tickets/new': 1,

  '/support/catalog/items/14': 2,

  '/support/catalog/items': 3,

  '/support/solutions': 4,

  'support/approvals/pending': 5

};


CARDS.map(function(card) {

  card.order = urlOrderMap[card.url];

});


CARDS.sort(function(c1, c2) {

  return c1.order - c2.order;

});

</script>


7. How can I prevent requesters from creating new users when submitting an incident or service request in the self-service portal?


Add the following script to Portal Customisation > Portal Layout > Footer. It intercepts form submissions on both service request and new ticket forms, checks whether the email entered in the "Requester" field already exists in the system, and blocks submission with an error message if the user is not found:

<script>

function checkUser(path, id, emailId) {

  var counter = 0;

  if (path >= 0) {

    var el = document.getElementById(id);

    el.addEventListener('submit', function(e) {

      if (counter == 0) {

        e.stopPropagation();

        e.preventDefault();

        var email = document.getElementById(emailId).value;

        var serverCall = performServerCall({

          url: API_URLS.ticket.verifyEmail,

          data: {

            v: email

          },

          method: 'GET'

        });

        if (counter == 0) {

          serverCall.then(function(result) {

            if (result.user_exists) {

              counter++;

              var event = new Event('submit', { bubbles: true });

              el.dispatchEvent(event);

            } else {

              new FSToastr({

                message: "Please check the email address in the requester field. You can only create tickets for existing requesters",

                type: "error"

              });

            }

          });

        }

      }

    }, true);

  }

}


jQuery(document).on('SideModalRendered', function() {

  checkUser(window.location.pathname.indexOf('support/catalog/items'), 'place-request-form', 'requester_email');

});


jQuery(document).on('PageUpdate', function() {

  checkUser(window.location.pathname.indexOf('support/tickets/new'), 'new-ticket-form', 'helpdesk_ticket_email');

});

</script>