Skip to content

Instantly share code, notes, and snippets.

@robhrt7
Last active June 25, 2019 05:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robhrt7/9080474 to your computer and use it in GitHub Desktop.
Save robhrt7/9080474 to your computer and use it in GitHub Desktop.
Preprocessors style guide cheatsheet
//
// Preprocessors style guide cheatsheet
// =============================================================================================
//
// Level 1
// ----------------------------------------------------------------------------------
.somecode {
}
// /Level 1
// ----------------------------------------------------------------------------------
// Level 2
// --------------------------------------------------
.somecode {
}
// /Level 2
// level 3
.somecode {
}
// /level 3
// Level 4
.somecode {
}
// =====================================================================
// Nesting
// =====================================================================
.weather {
.cities {
li {
// Maximum 3 nested levels
// Maximum 50 lines of nested CSS
}
}
}
// =====================================================================
// GLOBALS
// =====================================================================
// Links
// ---------------------------------------------------------------------
// basic
$al: '#eb722e'; //action link
$al_h: '#b84819'; //action hover
// aux
$o: '#449f14'; //object link
$o_h: '#32710d'//object hover
// Colors
// ---------------------------------------------------------------------
$tcolor: #000;
$tcolor-l1: lighten($tcolor, 20%);
$tcolor-i: #fff; //inverted
$pallete-color-1: #FF4900;
$pallete-color-2: #FFA700;
// Font sizes
// ---------------------------------------------------------------------
$fz-s: 12px;
$fz-m: 14px;
$fz-l: 16px;
// =====================================================================
// Mixins
// =====================================================================
// Media queries
// ---------------------------------------------------------------------
@mixin breakpoint($point) {
@if $point == l {
@media (max-width: 1600px) { @content; }
}
@else if $point == m {
@media (max-width: 1250px) { @content; }
}
@else if $point == s {
@media (max-width: 650px) { @content; }
}
}
// .module {
// width: 25%;
// @include breakpoint(s) {
// width: 100%;
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment