Extend a Sass File
Documentation article about Extend a Sass File Important: Important: Important: Important: Important: Important: Important:
Important:
Making changes to core JavaScript source files or changing vital functionality of the application can make migrating to future releases difficult. Before making changes to SuiteCommerce Advanced (SCA), see Best Practices for Customizing SCA.
This topic describes how to extend a Sass file if you are on the Kilimanjaro release of SCA or earlier. If implementing the Aconcagua release of SCA or later, the best practice is to use themes and extensions to customize your website. See Develop Themes and Develop Extensions for more information.
SCA enables you to customize your website to easily apply global style changes while supporting migration to later versions. When customizing styles, you create a custom module that overrides specific Sass variables already defined in the BaseSassStyles module. You then redefine application dependencies so that base Sass styles import your customizations in the correct order.
This example shows how to create a custom module to change the default background and foreground colors.
To extend a Sass file:
-
Create the directory structure to store your custom module.
-
Create a directory called
extensions. Where you place this depends on your implementation.-
If implementing 2019.2 and later, create the
extensionsdirectory within theSC_xxxdirectory within your root source directory. Examples:SC_20.1/extensions,SC_19.2_Live/extensions. -
If implementing 2019.1 and earlier, create the
extensionsdirectory within theModulesdirectory. For example:Modules/extensions.
-
-
In the
extensionsdirectory, create a subdirectory calledCustomSass@1.0.0.When creating a new custom module, the module name must be unique. You must not have duplicate module names, even if those modules reside in different folders.
-
In the
CustomSass@1.0.0directory, create a subdirectory calledSass.
In general, when creating custom modules, you should create a directory structure similar to that described in the procedure above. See Organize Source Code for Custom Modules for more information.
-
-
Create a Sass file.
-
In the Sass directory, create a new file called _custom-sass.scss.
-
Add Sass variable definitions to this file.
These variable definitions override the base Sass variables defined in the BaseSassStyles module. See Design Hierarchy for more information.
css1$sc-color-primary: #0000ff; // originally #f15c28;2 $sc-color-secondary: #00ff00; //originally #5B7F8C;3 $sc-color-theme: #00ff00; //originally #5B7F8C;4 $sc-color-link: #00ff00; //originally #2f9ac3;5 $sc-color-theme-light: #00aa00; // originally #9cb6bf6 $sc-color-theme-background: #000000;78 $sc-color-dark-copy: #e7d13b; // originally #1f2223;9 $sc-color-copy: #ede39f; //originally #404040;10 body {11 background-color: $sc-color-theme-background;12 }
-
-
Create the ns.package.json file.
-
Create a file called ns.package.json in the
CustomSass@1.0.0directory. -
Add the following code to the ns.package.json file.
json1{2 "gulp": {3 "sass": [4 "Sass/**/*.scss"5 ]6 }7}
-
-
Update the distro.json file.
-
Add an entry for your CustomSass@1.0.0 module to the distro.json file.
-
If implementing 2019.2 and later, the distro.json file is located in the Advanced directory of the SCA source code. Examples: SC_20.1/Advanced/distro.json, SC_19.2_Live/Advanced/distro.json
json1{2 "name": "SuiteCommerce Advanced Live",3 "version": "2.0",4 "isSCA": true,5 "buildToolsVersion": "Live",6 "folders": {7 "thirdPartyModules": "../../third_parties",8 "distribution": "../LocalDistribution",9 "deploy": "../DeployDistribution"10 },11 "modules": {12 "extensions/CustomSass": "1.0.0",13 "Account",14 "Balance",15 ... -
If implementing 2019.1 and earlier, the
distro.jsonflie is located in the root directory of your SCA source code.json{"name": "SuiteCommerce Advanced Mont Blanc","version": "2.0","buildToolsVersion
-
-
Frequently Asked Questions (4)
Does extending a Sass file apply to SuiteCommerce Advanced (SCA) Kilimanjaro release or later versions?
Where should I create the extensions directory for customizing Sass in SuiteCommerce Advanced?
What should I include in the ns.package.json file for a custom Sass module?
How do I update the distro.json file to include a custom Sass module?
Was this article helpful?
More in General
- Release Notes PDF Availability in NetSuite
NetSuite provides generated PDF files for each Release Note update, enhancing accessibility and user experience.
- Commitment Credits for Billing in NetSuite SuiteBilling
Commitment Credits in SuiteBilling enhance flexible usage-based billing across services. Managing usage-based billing in NetSuite SuiteBilling has been
- Prepay Across Subscriptions in NetSuite SuiteBilling
Prepay Across Subscriptions enables efficient management of prepaid services in NetSuite SuiteBilling.
- Edit the Extension Manifest: Manual Edits
Documentation article about Manual Edits Your extension's Workspace directory includes a manifest.json file, which includes all the information required to
Advertising
Reach General Professionals
Put your product in front of NetSuite experts who work with General every day.
Sponsor This Category