Version:

    Creating SCSS variables

    Site Studio allows you to create and manage SCSS variables which can be used within your CSS styles.

    Creating a SCSS variable

    To create a SCSS variable:

    1. Navigate to Site Studio > Website settings > SCSS variables 
    2. Enter a variable name in the Variable name field
    3. Enter a value in the Variable value field
    4. Click Save

    To add another variable, click Add and repeat the steps above before clicking Save.

    Changing the order of the SCSS variables

    You can change the order of the variables.

    1. Navigate to Site Studio > Website settings > SCSS variables 
    2. Click and hold on the Drag handle next to the variable you want to move and drag the variable up or down to reposition it
    3. Click Save

    Deleting a SCSS variable

    You can delete variables as long as they are not being used. To delete a variable:

    1. Navigate to Site Studio > Website settings > SCSS variables 
    2. Click the Delete button to delete a variable.

    Deleting a SCSS variable in use

    When a variable has been applied to a style, it's flagged as 'In use' and cannot be deleted. Instead of a Delete button, you will see an In use button.

    To delete a color in use:

    1. Navigate to Site Studio > Website settings > SCSS variables 
    2. Click on the In use button next to the variable you want to delete
    3. A modal will open showing a list of links to locations where the variable is being used
    4. Navigate to each of these locations and select a different variable
    5. When the variable is no longer in use, it will be unlocked and you will see a Delete button
    6. Click on the Delete button to delete the variable

    Locking a SCSS variable

    Locking a SCSS variable will stop the variable from being overridden if changes are detected when importing using Site Studio sync.

    1. Navigate to Site Studio > Website settings > SCSS variables
    2. Find the SCSS variable you want to lock
    3. Click Lock entity

    How to use SCSS variables

    SCSS variables can be used within the style builder. Navigate to a custom style or base style and type in the name of a variable that you have created for example "$section-padding" into a CSS property such as padding and save.

    When using a $variable within a calc, the variable must include the unit, for example 0.5rem.

    DX8 knowledge base icon

    Frequently asked questions

    Get instant answers to common questions. Available online 24/7.

    Find answers

    Raise a ticket icon

    Raise a support ticket

    To raise a ticket, sign into Acquia Cloud and select Help in the top menu.

    Raise support ticket

    Acquia

    Copyright © 2020 Acquia, Inc. All Rights Reserved. Drupal is a registered trademark of Dries Buytaert.