Skip to main content

Home/ CSS Evangelist/ Group items tagged DIG252

Rss Feed Group items tagged

Vernon Fowler

Choosing great variable names - 0 views

  • try to choose semantic names for your variables
  • describe its function or purpose
  • // Better $brand-color: red; $accent-color: yellow;
  • ...3 more annotations...
  • postfix color names with -color:
  • add a prefix like header- or footer- for specific sections: // Header $header-height: 100px; $header-background-color: $color-brand; // Footer $footer-height: 200px; $footer-background-color: #aaa;
  • I like to keep all my variables in a single file, called _config.scss, that I include in my primary stylesheet using the @import directive.
Vernon Fowler

Sass Style Guide | CSS-Tricks - 0 views

  • List @extend(s) First
  • List "Regular" Styles Next
  • List @include(s) Next
  • ...9 more annotations...
  • All Vendor Prefixes Use @mixins
  • Global and Section-Specific Sass Files Are just Table of Contents In other words, no styles directly in them. Force yourself to keep all styles organized into component parts.
  • If you find yourself using a number other than 0 or 100% over and over, it likely deserves a variable.
  • List Vendor/Global Dependancies First, Then Author Dependancies, Then Patterns, Then Parts
  • In Deployment, Compile Compressed
  • Comments get stripped when compiling to compressed code, so there is no cost.
  • Partials are named _partial.scss
  • Variablize All Colors Except perhaps white and black.
  • In your global stylesheet, @import a _shame.scss file last.
Vernon Fowler

On :target | CSS-Tricks - 0 views

  • I'd use these rules-of-thumb for when :target is a good choice: When a "state" is needed When the jump-down behavior is acceptable When it's acceptable to affect the browser history
Vernon Fowler

Confused About REM and EM? | Jeremy Church - 0 views

  • Use REM for consistent padding and margins
  • update font sizes and padding within a media query
  • @media screen and (min-width: 1400px) {   html { font-size: 1.25em; } }
  • ...2 more annotations...
  • If a style sheet is built in a modular fashion, then rem shouldn’t be needed very often, but it can be handy at times.
  • The initial values are calculated by incrementing 1em(16px) at a 1:1.2 ratio.
1 - 7 of 7
Showing 20 items per page