{"id":280768,"date":"2019-01-08T07:56:07","date_gmt":"2019-01-08T14:56:07","guid":{"rendered":"http:\/\/css-tricks.com\/?p=280768"},"modified":"2020-05-12T16:36:46","modified_gmt":"2020-05-12T23:36:46","slug":"sass-techniques-from-the-trenches","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/sass-techniques-from-the-trenches\/","title":{"rendered":"Sass Techniques from the Trenches"},"content":{"rendered":"\n
Having been in the web development industry for more than 14 years, I\u2019ve seen and written my fair share of good and bad CSS. When I began at Ramsey Solutions<\/a> five years ago, I was introduced to Sass. It blew my mind how useful it was! I dove right in and wanted to learn everything<\/em> I could about it. Over the past five years, I\u2019ve utilized a number of different Sass techniques and patterns and fell in love with some that, to steal Apple\u2019s phrase, just work<\/em>.<\/p>\n\n\n\n\n\n\n\n In this article, I\u2019ll explore a wide range of topics:<\/p>\n\n\n\n In my experience, finding the balance between simple and complex is the crucial component to making great software. Software should not only be easy for people to use, but for you and other developers to maintain in the future. I\u2019d consider these techniques to be advanced, but not necessarily clever or complex, on purpose!<\/p>\n\n\n\n “Everyone knows that debugging is twice as hard as writing a program in the first place. So if you\u2019re as clever as you can be when you write it, how will you ever debug it?”<\/p> \u2014The Elements of Programming and Style (2nd Edition), Chapter 2<\/em><\/p><\/blockquote>\n\n\n\n With that in mind, let\u2019s first look at Sass\u2019 ampersand.<\/p>\n\n\n\n There are many different naming conventions you can use to organize your CSS. The one I enjoy using the most is SUIT<\/a>, a variation of BEM<\/a> (which is short for B<\/strong>lock, E<\/strong>lement, M<\/strong>odifier). If you\u2019re unfamiliar with SUIT or BEM, I\u2019d recommend taking a peek at one or both of them before moving on. I\u2019ll be using the SUIT convention throughout the rest of this article.<\/p>\n\n\n\n
\n\n\nThe power of the ampersand<\/h3>\n\n\n