SASS can be used in many situations. This can include:
Let's deal with each point separately. During the course, you can use any option you're comfortable with. When working with real projects, it's better to install SASS as a package on your system. Then, using assemblers, you'll be able to automate compilation, i.e., the conversion of code from SASS to CSS.
If you want to use SASS in an online environment, almost any online code editor you know will work. For example, CodePen. In the CSS tab, you can tell it to use the SASS preprocessor. For SCSS syntax, you need to select the appropriate drop-down menu item.
This is the easiest and fastest option for writing CSS code using the SASS preprocessor.
Another popular tool is the Sassmeister service. It allows you to quickly translate SASS code into plain CSS. The advantage of this service is the ability to select different types of compilers. This allows you to test your code under different conditions and possibly identify a few bugs you may encounter.
You can install separate software that will compile preprocessor files into normal CSS. There are many such programs, and many of them are available for all major platforms (Windows, Linux, macOS). One common program is Koala. It's available for all major platforms, and its intuitive interface allows you to quickly understand how to compile preprocessor files.
Simply select the directory with your .scss, and Koala will automatically convert them to .css.
You can install SCSS as a normal npm-package on your system. This is the easiest and fastest way, allowing you to use SASS without installing additional software, and it doesn't require an Internet connection, as is the case with online services.
When installing SASS make sure you have Node.js installed. Open the terminal and run the following command:
sudo npm install -g sass
After installing Chocolatey run the following command:
choco install sass
Use the following command to install SASS on macOS:
brew install sass/sass/sass
After installing the package, the sass command will be available to you in the terminal. In its basic form, you only need to pass it two parameters:
sass /project/src/style/style.scss /project/build/style/style.css
In addition to being able to compile, you'll also be able to run an interactive (shell). With it you can easily experiment with different SASS functions. To start the interactive shell, run the sass -i command in the terminal:
sass -i
>> 1px + 1px
2px
As you go through the course, you'll encounter different features. Try them in the interactive shell.
All examples and exercises in this course will be compiled using this library. The library is called Dart-SASS. This is important because different compilers can handle SASS code differently. The differences are insignificant, but it's worth trying to identify the differences when choosing a different library.
Install SASS on your computer using a batch manager. Try creating a file with a .scss extension and compiling it. You can enter the following code in the scss file:
header {
width: 50%;
background: brown;
&.w-100 {
width: 100%;
}
}
See what you get in the .css file after compilation.
The Hexlet support team or other students will answer you.
A professional subscription will give you full access to all Hexlet courses, projects and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.
Programming courses for beginners and experienced developers. Start training for free
Our graduates work in companies:
Sign up or sign in
Ask questions if you want to discuss a theory or an exercise. Hexlet Support Team and experienced community members can help find answers and solve a problem.