TABLE OF CONTENTS
- Overview
- 1. How your CSS is applied
- 2. Choose view: Browser, mobile app, and both
- 3. Specify CSS and ensure your override prevails
- 4. Customise portal-wide
- 5. Customise pages
- 6. Customise components on each page
- Home (portal_home, #home-page-container)
- Ticket list (ticket_list, #sec-ticket-list), Changes (#sec-change-list), Journey requests (#sec-journey-requests-list)
- Ticket details (ticket_view, .ticket-show-container)
- New ticket (submit_ticket, #ticket-new-main)
- Service catalog (catalog_items, #catalog-list-page), Catalog item (catalog_item, #service-request-container)
- Journeys
- Solutions and articles
- Action items, approvals, login, sign-up, profile
- 7. Components for mobile app only
- 8. Select container and keep styles contained
- 9. Check anti-patterns
- 10. Use sample snippets
- Mobile app only
- M1. Ticket list: "open" status pill colour
- M1 b. Ticket page: reply button colour (a place where !important is required)
- M2. Bottom navigation: active tab colour
- M3. Bottom sheets: corner radius and title
- M4. Form text fields: rounder corners and a brand focus ring
- M5. Mobile page title (back-button row)
- M6. Snackbar (confirmation and error messages at the bottom of the screen)
- Browser only
- Both views
- Mobile app only
- 11. Customise placeholders in templates
- 12. Use custom scripts in customisation templates
- 13. Test with checklist
- Frequently asked questions (FAQs)
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:
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:
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; }
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:
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.
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:
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.
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.
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:
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:
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
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.
Classic-layout pages
A subset of portal pages retains the classic layout architecture while integrating the refreshed visual theme on top:
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)
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.
Ticket details (ticket_view, .ticket-show-container)
New ticket (submit_ticket, #ticket-new-main)
Service catalog (catalog_items, #catalog-list-page), Catalog item (catalog_item, #service-request-container)
Journeys
Solutions and articles
Action items, approvals, login, sign-up, profile
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.
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:
Find the target page's body[page="…"] attribute and corresponding root container in the ‘Customise pages’ section.
Inspect the element you wish to modify using DevTools on that page to identify its component container along with its associated classes or IDs.
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.
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
9.2 Mobile app only
9.3 Browser only
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:
Locate the portal rule for the property you wish to modify by inspecting the element using DevTools.
Should the declaration include !important, match or increase selector strength and apply !important exclusively to that specific declaration.
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.
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:
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.
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:
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
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:
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:
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(…).
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
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
Stylesheet validation: Verify that the stylesheet saves successfully. Any save failure indicates unsupported syntax (refer to the ‘How your CSS is applied’ section).
Desktop browser view: Review each targeted page on a desktop display.
Mobile browser view: Inspect targeted pages in DevTools device mode (at widths of 767px or narrower) to confirm responsive layout adjustments.
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.
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).
Right-to-left (RTL) support: If an RTL language is supported, validate at least one page in that localization.
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).
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>