SCSS
SCSS is a CSS preprocessor that offers additional features and syntax to enable more efficient and organized CSS development. Learn how Slides slides utilize all of those features.
Introduction
SCSS (Sassy CSS) is a preprocessor for CSS that adds a number of powerful additional features to CSS, that allows you to write more efficient, organized, and maintainable CSS by providing additional tools and syntax that are not available in regular CSS.
In order to use SCSS on a web page, it must first be compiled or converted into standard CSS because SCSS is not directly supported by web browsers. Slides 6.1 (and later) automatically converts your SCSS code into standard CSS for the preview and exported versions.
Here are the most interesting features of SCSS you can bring into your Slides 6 Project:
Nesting
SCSS allows you to nest your CSS rules, making it easier to read and write your styles:
Nesting in SCSS allows you to structure your styles in a more intuitive and organized way. With nesting, you can define styles for a specific element and its children within the same block of code, rather than having to define them separately. This can make your styles more readable and easier to understand, especially for large and complex stylesheets.
Variables
SCSS allows you to define variables that can be used throughout your stylesheet, making it easier to maintain and update your styles.
Variables in SCSS allow you to define reusable values that can be used throughout your stylesheet. This can make it easier to maintain and update your styles, as you only need to update the value of a variable in one place, rather than having to find and update every instance of that value throughout your styles.
Mixins
SCSS provides a way to define reusable blocks of styles called mixins, which can be included in your styles using the @include
directive.
Mixins in SCSS allow you to define reusable blocks of styles that can be included in multiple places throughout your stylesheet. This can make it easier to write and maintain your styles, as you can define common styles in a single mixin and reuse them throughout your stylesheet, rather than having to write the same styles multiple times.
Functions
SCSS allows you to define custom functions that can be used to perform calculations and return values that can be used in your styles.
Functions are a useful tool in SCSS that can help you write more efficient, maintainable, and readable CSS.
Operators
SCSS provides a number of arithmetic and logical operators that can be used to perform calculations and create complex styles.
Operators can be used to perform a variety of calculations within your styles, including arithmetic operations like addition, subtraction, multiplication, and division, as well as logical operations like comparison and boolean operations. This can be useful for creating complex styles that require precise values, such as layout styles that depend on the viewport's size or styles that need to be adjusted based on user input.
More features you can learn on the official website: https://sass-lang.com/
Slides SCSS
Using [this] shortcut
For the cases, where you want to wrap specify your styles within just one slide you can wrap your code with [this]
:
Please note that the [this]
shortcut is only available for use within the Slides App and should not be used as a replacement for the unique ID of an element. Upon export or preview, [this] will be replaced with the original ID name. The resulting code will be converted to valid SCSS/CSS for both local and exported versions.
Slides Variables
Colors
The Slides Framework includes a number of predefined color variables that you can use in your SCSS. These variables are named after the corresponding preset class names in the "Colors" tab of the Slides App. For example, you can use the $lightGreen
variable to set the same color as the .lightGreen
class. This allows you to easily apply the same color styles across your project without having to manually specify the color values.
This allows you to easily apply the same color styles across your project without having to manually specify the color values.
Other Variables
The Slides framework includes a number of SCSS variables that you can use or modify in your project. It is recommended to keep these variables outside of the [this]
element to avoid conflicts with styles within your slides.
Available Mixins
You can use the media
and mediaRange
mixin functions in SCSS to insert a special media query that will apply the specified code only for a specific width. For example:
The mediaRange
function can also be used to apply styles within a range of widths, like this:
Autoprefixer
Autoprefixer is a tool that automatically adds vendor prefixes to CSS rules to make it easier to write and maintain cross-browser-compatible CSS. Vendor prefixes are a way for browser vendors to add support for new CSS features before they are fully supported by all browsers. Autoprefixer helps to ensure that these vendor prefixes are added to your CSS in a consistent and automated manner, making it easier to write and maintain your styles.
It's worth noting that the Slides App does this for your styles by default. This means that you don't need to do anything special to use Autoprefixer. All of the necessary vendor prefixes will be added automatically, so you can focus on writing your styles without worrying about cross-browser compatibility.
CSS Output Minifier
A minifier is used to reduce the size of a file by removing unnecessary characters, such as whitespace and comments, from the source code. It can help to optimize the size of the compiled CSS file for production by removing unnecessary characters. By default, the Slides App uses the minified version of the styles (slides.min.css) that have been converted from SCSS. However, you also have the option to use the unminified version of the styles if desired. Both minified and unminified versions are exported by the Slides App.
Installation (optional)
For advanced users who would like to make deep changes to the SCSS files locally, you have the option to install a preprocessor on your computer. Please note that this step is optional and not necessary for basic usage of the SCSS files.
Last updated