Scss Cheat Sheet
SCSS Cheatsheet A practical guide to SCSS features. This article aims to provide a list of the features of SCSS and show some of their use cases, limitations and how they could be used in practice. 1 HTML Cheat Sheet 🔥 - The Most Useful HTML Tags 🚀 2 The Ultimate Go Cheatsheet 🚀 Best Go Concepts 3 SASS Cheat Sheet 🔥 - Best SASS Cheatsheet Online 🚀 4 VS Code Shortcut Cheat Sheet🔥 - Productivity boost 🚀. Easing functions specify the speed of animation to make the movement more natural. Real objects don’t just move at a constant speed, and do not start and stop in an instant. This page helps you choose the right easing function. CSS, SCSS and Less. Visual Studio Code has built-in support for editing style sheets in CSS.css, SCSS.scss and Less.less.In addition, you can install an extension for greater functionality. The complete CSS cheat sheet PDF and PNG includes the latest CSS3 tags and attributes. Perfect for beginners and free to download!
VS Code extension that lets you open a flexbox cheatsheet directly in the editor. FeaturesThe cheatsheet can be opened in a few ways:
Besides the
Most properties also have interactive playgrounds that are part of the cheatsheet. SettingsAfter opening the cheatsheet, you can select the directionality to be used in the interactive playgrounds. This is especially useful for languages that write from right-to-left. Learn more. ColorsThe colors of the cheatsheet automatically adapt to the selected theme. The font is based on the user’s preferred font. Support my workIf you find this extension useful and would like to support my work, you can buy me a cup of tea. Thank you! DemoUsing the |
If you always feel you have to look up CSS terms, checkout this cheatsheet! It will make your CSS life easier.
If you always feel you have to look up CSS terms, checkout this cheatsheet! It will make your CSS life easier. I applied some if this tricks while I was building Museo, a Vanilla CSS/SCSS Landing Page.
Know About the Three Pillars to Write Good CSS
- Responsive Design: Building a website that works well on all devices. You’ll have to know about fluid layouts, media queries, responsive images, correct units (for e.g. font sizes) and desktop-first vs mobile-first.
- Writing maintainable/scalable code: Write code that is clean and reusable. Think about CSS folder architecture, and class naming.
- Web Performance: Make it faster and smaller in size. Less HTTP requests, compress code, and use a CSS preprocessor. Also less images and if images, compress them.
Reset Styles Globally
Sometimes you want to reset styles from those that might be imposed by the browser by default. Here’s an example
Attribute Selectors
We can select attributes by wrapping them in []
Converting px
units to rem
The rem
unit is related to root font size. So by setting the root font size, then use rem so you can easily make changes to root without changing all lines of codes. You can specify root font size. Instead of having root font as as px we could use percentages.
Since usually default font size is 16px here we are saying 62.5% which is roughly 10px. This will mean that 1rem is 10px, 2rem is 20px and so forth.

You can then use rem as this:
!important
!important
overrides specificity rules. Can save headaches to make it work before you debug accordingly.
You can add it also on utilities (using SASS), as reusable stylings. Read more.
box-sizing: border-box
With box-sizing: border-box
we can change the box model. This is useful when an element’s specified width and height aren’t affected by padding or borders. This has proven so useful in responsive design that has found its way into reset styles. So border-box can help make responsive layouts more manageable.
clip-path: polygon()
You specify the polygon you want to add the clipping. Then you add clippings with x and y coordinates left to right. Use Clippy tool to calculate it for you! You can make some cool polygon effects.
CSS Animations with @keyframes
and animation
We use @keyframes
and then give animation a name. Then you specify what happens when animation starts, ends and anything in the middle.
Then once you define it, you can add it to the specific element you want to apply with the animation
keyword.
backface-visibility: hidden
Whenever you work with animations and with translate()
, many times backface-visibility: hidden;
fixes many errors. So try to add it if you are having issues!
overflow: hidden
Another trick when an element is too big and is overflowing. You can use overflow: hidden
to fix it.
Pseudo Elements and Pseudo Classes
Pseudo classes are a special state of a selector. For example .btn:link
selects the elements on a special condition in this case when a button is a link.
Pseudo elements allow us to select certain part of an element. They are denoted with two colons to differentiate them from pseudo classes. This is the syntax:
Css Selectors Cheat Sheet
There are various pseudo elements. Take a sneak peak and learn more about them here.
box-shadow
With box shadow you can add shadow to elements. Take a look at this box shadow generator.
@supports
For Older Browser Support
You can do graceful degradation with @supports
. Example:
This will make your CSS support older browsers.
BONUS - SASS Preprocessor
If you wanna use SASS in your project just install it with npm i node-sass --save-dev
.
Implement SASS Variables
We can use SASS to implement variables, e.g. when specifying colors.
Implement Nesting With SASS
In SASS you can do nesting and it will read much better.
Note that &
replaces selectors up to the point. So in normal CSS this will equate .navigation li:first-child
. In CSS we would write everything above as the following (notice how we save a lot of repetition):
Be careful on how deeper you go on nesting. Usually don’t go deeper than two levels!
Mixins
Mixin is a reusable piece of code. Let’s say we want to implement a Clearfix in multiple places. We use the @mixin
keyword to define it and @include
where we want to use it.
You can also pass in variables to mixin definitions. Just make sure when you want to use it, also pass in the variable for the mixin to work. Mixins then do become like functions. There are also extends and functions in SCSS so become familiar with them, but mixins are used the majority of times.
Fast Development Environment with SASS
Remember to install SASS. Then you can compile by adding this script in package.json:
The -w
will keep watching for whatever we do in our code. You can also install npm i live-server -g
. Then run it as live-server
on root folder. For the changes to be reflected without needing to reload manually.
Build Scripts for SASS
We can implement simple NPM build processes after we finish a feature.
Css Cheat Sheets Pdf Printable
There are a couple of NPM packages we use, we can install as npm i concat --save-dev
, npm i autoprefixer --save-dev
, npm i postcss-cli --save-dev
, npm i npm-run-all --save-dev
.
We do this on package.json
, check it on Github repository or see below the updated scripts part on package.json:
Note the --parallel
flag on start script. It means both run at the same time. On compile script be careful of your own .scss and .css file locations and update it accordingly.
It doesn’t matter if you don’t understand everything. To compile your SASS into CSS all you do:
npm run build:css
Css Cheat Sheet Download Pdf
With this, your CSS will be compiled, concat, compressed and ready for production! Bam💥
Even More Tricks and Resources
- CSS Reference you can take a look.
- Emmet Cheat Sheet. Write HTML faster in VS Code
- Easings.net.Pick your favorite transition and then copy the
cubic-bezier
function and voila! You can compare bezier curves with this tool. - Sizzy, a tool for responsive website building.
- Can I Use, for browser support checking
