You are here:
Use the Newport Design System
The Newport Design System allows you to customize the appearance and behavior of Omniscript elements. Newport includes Storybook.js, a browser-based preview tool, that enables you to see your design changes in action.
Before You Begin
If you're unfamiliar with using command-line interfaces, refer to the Command Line 101 guide.
System requirements:
- Git. See Git documentation
- Node.js v12 or higher. See Node documentation.
- Gulp CLI:
Install via npm install --global gulp-cli
Install the Newport Design System:
- Clone the vlocityinc/newport-design-system repository from GitHub using a command-line interface. To see what components are provided by Newport, check the contents of the UI/components directory.
-
Change your current directory to newport-design-system:
cd newport-design-system -
To work with the correct version of the Salesforce package, switch to the corresponding
branch:
git checkout release_version -
Install the dependencies:
npm install -
Launch the Storybook.js preview:
npm start - Use the Storybook preview to review the available components and configurations.
- Add customizations to your theme. See Customize Your Omniscripts Using the Newport Design System.
- Apply your customizations either to individual Omniscripts, or globally across your organization. See Deploy and Apply Global Styling Changes using the Newport Design System.
Customize Your Omniscripts Using the Newport Design System
To customize the appearance of your Omniscripts, edit the CSS and HTML files in the UI subdirectory of the directory where you cloned Newport.
Themes are stored in the design-tokens folder. To create a new theme for your Omniscripts:
- Copy the vlocity-newport-skin folder to a new folder.
- Edit the files in the new folder as required.
-
To change the color scheme, modify the color.yml files. Colors are
defined using hex RGB codes or tokens that resolve to hex values, which are defined in the
aliases/color.yml file.
For example, to change the color of a specific component, such as the input element’s orange underline:
- Edit design-tokens/vlocity-newport-skin/background-color.yml.
-
Update COLOR_BORDER_INPUT_ACTIVE to a different color token
defined in /aliases/color.yml. When you change colors, the Newport
components are recompiled, so there is a slight delay before your changes are reflected in
the Previewer. To verify your change, view the input component using the Previewer.
For optimal rendering on all platforms, set the control width to 6. Smaller widths may not render correctly on every platform.
-
To preview the effect of Newport Design System styles on an Omniscript:
-
Edit the Script Configuration and paste the path to the top-level CSS file (by default,
xxx.css) into the CUSTOM HTML TEMPLATES field.
The Newport Previewer allows you to see how components render across desktops, tablets, and smartphones.
- To preview an element or utility, choose it from the lists on the left pane. To view the code behind it, click </>.
- To navigate the component hierarchy, use the restriction tree, which shows element definitions from base to derived implementations.
- To view a specific definition, click the corresponding node in the restriction tree.
-
Edit the Script Configuration and paste the path to the top-level CSS file (by default,
xxx.css) into the CUSTOM HTML TEMPLATES field.
Deploy and Apply Global Styling Changes using the Newport Design System
Apply modifications to the Newport Design System by adding a static resource that overrides the Newport theme wherever it's available. After it's uploaded, the changes are applied to all Omniscripts that are on the Newport Design System.
- Download the Newport Design System. See Apply Global Branding to Omniscripts.
-
Create a distribution folder containing your changes by issuing this command:
npm run-script dist - In versions before Vlocity Spring '19, change (cd) to the dist folder and zip its contents. (Do not zip the top-level dist folder: cd into it and zip its contents.)
- In Salesforce, upload the zip file as a static resource.
- In your Salesforce org, go to Setup and, in the Quick Find box, enter Custom Settings.
- Find UISettings, click .
-
Configure these settings:
- Name: Enter
newportZipUrlfor the changes to be applied. - Key: Enter a custom name.
- Value: Enter the relative URL for the static resource containing your custom styles. To get this URL, go to Static Resource (see 4 in the Before You Begin section), hover over the View File link, right-click and copy the URL. Enter the relative URL after the domain name, removing the query string (question mark) at the end, leaving just the relative path. For example, the bold text would be copied in this URL: https://MyDomainName--c.vf.force.com/resource/16679825000/vloc_customNewport?
- Name: Enter
- To enable Newport or Newport Storybook theme on an Omniscript, open an Omniscript and select Newport or Newport Storybook from the dropdown on the designer canvas or Preview page.
After selecting the Newport theme in the designer canvas, the Omniscript automatically appears in the Newport theme when previewed. Switching to Lightning in the preview page displays the Omniscript in the Lightning theme in the designer canvas.
When creating a new version of an Omniscript originally built with the Newport theme, the new version opens in the designer canvas with the Lightning theme selected by default.

