Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Layouts
  • Getting Started
    • Create a theme
    • Develop a theme
    • Setup a theme
    • Publish a theme
  • Requirements & Review
    • Overview
    • Main Requirements
    • Review Process
      • UI / UX Review
      • Technical Review
      • Metadata Review
      • Pre-Launch Review
  • Files and Folders Structure
    • Directory structure
    • Twilight.json
  • Twig Template Engine
    • Basic syntax
    • Twilight flavoured twig
  • Theme Architecture
    • Layouts
      • Overview
      • Master Layout
      • Global Variables
      • CSS Variables
      • Salla Icons
      • Custom Fonts
      • Hooks
      • Localizations
    • Pages
      • Overview
      • Home Page
      • Product Pages
        • Products listing
        • Single product
      • Customer Pages
        • Profile
        • Orders list
        • Order details
        • Wishlist
        • Notifications
      • Blog Pages
        • Blog listing
        • Single blog
      • Brand Pages
        • Brands listing
        • Single brand
      • Common Pages
        • Cart
        • Loyalty
        • Thank you
        • Single page
        • Landing Page
    • Componenets
      • Overview
      • Home Components
        • Youtube
        • Fixed banner
        • Testimonials
        • Parallax background
        • Photos slider
        • Store features
        • Square photos
        • Fixed products
        • Products slider
        • Featured products - Style 1
        • Featured Products - Style 2
        • Featured Products - Style 3
        • Brands
        • Enhanced Square Banners
        • Main Links
        • Enhanced Slider
        • Slider Products with Headers
        • Latest Products
        • Vertical Menu with Slider
      • Product Components
        • Essentials
        • Options
      • Common Components
        • Header Components
        • Footer Components
        • Comments component
  • Change Log
  1. Layouts

CSS Variables

Theme CSS variables allow the themes style to be modified by altering the font type and color code. This step provides options for the developer to apply changes on the Themes as well as enabling them using the Theme features in Salla Partners Portal. The CSS variables can be placed in the pages the developer wants to apply the styles on, or it can be placed in the master layout.
A thing to know!
To make a unified theme style using CSS variables, it's advised to place the variables in the master layout which helps to apply it globally.
This article walks through how the developer can change the theme styles using the Theme CSS variables and how to enable the features in the Partners Portal.

📙 What you'll learn#

Assigning the Theme CSS variables.
Enabling CSS variables in Salla Partners Portal.

Assigning the themes CSS variables#

Colors and fonts are the predominant features of the theme, which can be set by assigning the thems CSS variables. This section explains how he developer can assign CSS variables of the theme where the merchant has the ablility to change the font and color of theme once it's appiled in their store. As illustrated below:
The developer can use the above CSS variables to assign their values as mentioned in the follwoing table.
CSS VariableDescription
--font-mainThis line will assign the font type to be applied in on the page
--color-primaryThe primary color will be assigned to the font
--color-primary-darkThis line modifes the primary color to suit the dark mode for the theme, in this case it darkens the color by 15%
--color-primary-lightThis line modifes the primary color to suit the day mode for the theme, in this case it brightens the color by 15%
--color-primary-reverseThis line selects the reverse color for the primary color which is the oppoist of the primary color
Another possibility is that the developer provids fixed values to the CSS variables. This would prevent the merchant from altering the theme's typeface or color scheme, as demonstrated by the following line of code:
The CSS variables assignes the font-main with 'Times New Roman' and the colors with the specific color code in HEX form, the font and color will then be applied to the theme.

Enabling CSS variables in Salla Partners Portal#

Twilight themes grants the ability for the merchant to adjust the store theme fonts and colors which is available with the help of CSS variables that were assigned by the developer in the previous section. After assigning the CSS variables by the developer, the font and color can be enabled by using the Theme features in the partners portal
Themes Features
By enabling the features, it allows the merchant to make changes to the themes fonts and colors.
Educational Clip
Modified at 2024-09-03 09:52:41
Previous
Global Variables
Next
Salla Icons