Getting Started Flashcards
Sass is a compiler, which means that it:
turns an input into an output
What is the output for Sass?
CSS
You need an output for Sass because:
browsers don’t understand Sass, but can understand CSS
Using what flag automatically refreshes your CSS output files?
Watch
The command we use to install Sass is:
gem install sass
Is Scout an app that helps you avoid the command line?
Yes
What computer programming language was Sass originally written in?
Ruby
Libsass is a variant of Sass that:
can be ported to other programming languages
Add some nested Sass that makes all tags within
tags red.
p {
color: blue;
a {
color: red;
}
}
Use a nested selector to say all tags within
tags are red.
Add another nested selector which makes all tags that are direct children of
tags blue.
We want to add a style to our previous Sass code declaring that on hover, all direct children have an opacity of 0.5. Use the ampersand selector to achieve this, rather than repeating the > adirect child selector.
We want to add an exception for tags that are in the with a class of .footer: those links should be purple. Use the post-selector ampersand to achieve this.
p {
a {
color: red;
div.footer & {
color: purple;
}
}
> a {
color: blue;
&:hover {
opacity: 0.5;
}
}
}