Service Portal SCSS Primer
-
- UpdatedAug 3, 2023
- 4 minutes to read
- Vancouver
- Service Portal Designer
SCSS is a subset of the Syntactically Awesome StyleSheets (Sass) specification and is an extension of CSS. Every valid CSS style sheet is valid SCSS.
SCSS variables
SCSS variables are a way to store information that you want to reuse throughout your style sheet. You can store things like colors, font stacks, or any CSS value you think you want to reuse. SCSS uses the $ symbol to make something a variable.
SCSS supports the follow data types:
- Numbers (including units)
- Strings (with quotes or without)
- Colors (name, or names)
- Booleans
Variables can also be arguments to or results from one of several available functions or mixins. During translation, the values of the variables are inserted into the output CSS document.
For more information on Sass, see the Sass/SCSS reference.
SCSS functions
List of functions for Service Portal SCSS compiler.
RGB functions
HSL functions
Opacity functions
Other color functions
String functions
Number functions
List functions
Lists in SCSS are immutable. All list functions return a new list rather than updating the existing list in-place.
All list functions work for maps as well, treating them as lists of pairs.
Adding custom functions
Scss @function my-calculation-function($some-number, $another-number){ @return $some-number + $another-number }
SCSS nesting
SCSS lets you nest your CSS selectors in a way that follows the same visual hierarchy of your HTML.
ul
, li
, and a
selectors are nested
inside the nav
selector, which is a great way to organize your CSS and make
it more readable. When the widget is rendered, the generated CSS looks something like the
following code
block:For more information on Sass, see the Sass/SCSS reference.
SCSS operators
SCSS has a handful of standard math operators like +, -, *, /, and %.
&
article. For
example:
The generated CSS looks
like:For more information on Sass, see the Sass/SCSS reference.
SCSS mixins
A mixin lets you make groups of CSS declarations that you want to reuse throughout your site. You can pass in values to make your mixin more flexible.
For more information on Sass, see the Sass/SCSS reference.