{"id":5947,"date":"2017-01-04T12:01:48","date_gmt":"2017-01-04T12:01:48","guid":{"rendered":"https:\/\/9series-blog.staging9.com\/?p=5947"},"modified":"2026-03-03T10:44:09","modified_gmt":"2026-03-03T10:44:09","slug":"sass-hits-html5-developers-toolbox-in-india","status":"publish","type":"post","link":"https:\/\/www.9series.com\/blog\/sass-hits-html5-developers-toolbox-in-india\/","title":{"rendered":"SASS Hits the HTML5 Developers ToolBox"},"content":{"rendered":"<p>SASS, the Buzzing word is the realm of web development industry. You may scratch your head in surfing over the gigantic database of google to get a quickstart on the idea of the CSS preprocessor and have reasons to choose SASS with a specific end goal to execute in your development phase.<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2017\/01\/1_SASS-Hits-the-HTML5-Developers-ToolBox.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1837\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2017\/01\/1_SASS-Hits-the-HTML5-Developers-ToolBox.jpg\" alt=\"1_sass-hits-the-html5-developers-toolbox\" width=\"800\" height=\"500\" \/><\/a><\/p>\n<p>Nowadays, the technologies that front-end developers entails to know right out of the door have broadened to likewise incorporate tools that streamline the work they do. CSS preprocessor is the heart of front-end developers which supercharges their productivity, to compose more concise CSS, and to keep files organized. Either it\u2019s Sass, LESS, or Stylus, a pre-processor which can help build upon some of the CSS3\u2019s best features. In this blog, we will check out Superpowers of SASS and how it paced in the html5 developer&#8217;s toolbox.<\/p>\n<p><span style=\"font-weight: bold\">What is SASS?<\/span><\/p>\n<p>This is the very first question comes in everyone\u2019s mind. <a href=\"http:\/\/hamptoncatlin.com\/\" target=\"_blank\">Hampton Catlin<\/a> and <a href=\"https:\/\/github.com\/nex3\" target=\"_blank\">Nathan Weizenbaum<\/a> proposed a better way to maintain a complicated stylesheet and they developed a superpower named<a href=\"http:\/\/sass-lang.com\/\" target=\"_blank\"> SASS<\/a>, which stands for Syntactically Awesome Style Sheets.<\/p>\n<p><span style=\"font-weight: bold\">How to get started with SASS?<\/span><\/p>\n<p>Initial steps of process during installation. Guys don\u2019t panic below are the steps to install.<\/p>\n<p style=\"margin-top: 10px\">To run Sass, you will need to have Ruby installed. Mac guys are lucky one&#8217;s, Ruby already comes preinstalled. Numerous different libraries, such as libSass which migrate Sass to NodeJS, without any need for Ruby.<\/p>\n<p><span style=\"font-weight: bold\">Linux<\/span><\/p>\n<p>If you&#8217;re using Linux, you need to install Ruby first. You can install Ruby through the <span style=\"font-weight: bold\">apt package manager, rbenv, or rvm.<\/span><\/p>\n<p>To install SASS, you need to run a command in your terminal:<\/p>\n<p><span style=\"font-weight: bold\">sudo su -c &#8220;gem install sass&#8221;<\/span><\/p>\n<p><span style=\"font-weight: bold\">Windows<\/span><\/p>\n<p>If you&#8217;re using windows, before you start using Sass you will need to install Ruby. The fastest way to get Ruby on your Windows computer is to use Ruby Installer. The installer will also install a command line powershell application that will let you use the Ruby libraries.<\/p>\n<ul>\n<li>To install SASS, you need to run a command in your terminal: <span style=\"font-weight: bold\">gem install sass<\/span><\/li>\n<li>Double Check that Sass is installed: <span style=\"font-weight: bold\">Sass -v<\/span> It should return<span style=\"font-weight: bold\"> Sass 3.4.22 (Selective Steve)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: bold\">Mac<\/span><\/p>\n<p>If you&#8217;re using Mac, ruby comes pre-installed. All you need to do is to run a command in the terminal.<\/p>\n<ul>\n<li>To install SASS, you need to run a command in your terminal: <span style=\"font-weight: bold\">Sudo gem install sass<\/span><\/li>\n<li>Double Check that Sass is installed: <span style=\"font-weight: bold\">Sass -v<\/span> It should return<span style=\"font-weight: bold\"> Sass 3.4.22 (Selective Steve)<\/span><\/li>\n<\/ul>\n<p>Once everything is setup we can jump to the basics now.<\/p>\n<p><span style=\"font-weight: bold\">Why to opt for Pre-Processing CSS?<\/span><\/p>\n<p>During the research on CSS preprocessor. Using special, supercharged CSS files that include factors, capacities, &#8220;mixins&#8221;, and different components. Once the development completes or in process, these files would then be compiled into regular CSS files which are compatible to all web browsers because scss files do not have compatibility in web browsers.<\/p>\n<p>With SASS the same mystical preprocessing takes place. The terminal will take your preprocessed Sass file and convert the sass syntax into a normal CSS syntax that you can use in your website.<\/p>\n<p>The most direct way to make this happen is in your terminal. Once Sass is installed, you can run <span style=\"font-weight: bold\">sass input.scss output.css<\/span> from your terminal. You can watch either individual files or entire directories. In addition, you can watch folders or directories with the <span style=\"font-weight: bold\">&#8211;watch flag.<\/span><\/p>\n<p>An example of running Sass while watching an entire directory is the following:<\/p>\n<p><span style=\"font-weight: bold\">sass &#8211;watch app\/sass:public\/stylesheets<\/span><\/p>\n<p>Using the terminal is just a option for those who have a good hand on it but there is always a way to compile. There a many open source and paid software\/applications for compiling. But we recommend using scout. Scout is a open source application good for pre-processing very simple to use.<\/p>\n<p><span style=\"font-weight: bold\">5 Reasons to consider SASS for your development<\/span><\/p>\n<p style=\"margin-top: 10px\">Let\u2019s have a closer look at some of Sass\u2019s core advantages and how they can transform CSS.<\/p>\n<p><span style=\"font-weight: bold\">1) Beat the Clock with Variables.<\/span><\/p>\n<p>Sass provides variables as a mechanism to store information which can be reused throughout your stylesheet. Variables helps to cut down the time on repetitive work.<\/p>\n<p>Let&#8217;s say you\u2019re using some cool shade in your application. Later on, your client doesn\u2019t like the shade, and then you\u2019re forced to change the colour, the only thing strikes are a lot of changes in the plain CSS. Well, sass reduces all this effort with variables. All you have to do is to declare a variable. You can store things like colours, fonts, or any CSS value you think you\u2019d reuse. Sass uses the <span style=\"font-weight: bold\">$<\/span> symbol to make something a variable.<\/p>\n<p><span style=\"font-weight: bold\">Here&#8217;s an example:<\/span><\/p>\n<p><span style=\"font-weight: bold\">SASS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\n$font-stack:Helvetica, sans-serif;<br \/>\n$primary-color: #333;<br \/>\nbody{<br \/>\nfont: 100% $font-stack;<br \/>\ncolor: $primary-color;<br \/>\n}<br \/>\n<\/code><\/p>\n<p>When the Sass is processed, it takes the variables that we define for the <span style=\"font-weight: bold\">$font-stack<\/span> and <span style=\"font-weight: bold\">$primary-color<\/span> and outputs normal CSS with our variable values placed in the CSS.<\/p>\n<p><span style=\"font-weight: bold\">CSS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\nbody {<br \/>\nfont: 100% Helvetica, sans-serif;<br \/>\ncolor: #333;<br \/>\n}<br \/>\n<\/code><\/p>\n<p><span style=\"font-weight: bold\">2) Make your code easier to maintain<\/span><\/p>\n<p>It\u2019s better known that fewer codes lead to better productivity which is forever a win. Many times <a href=\"https:\/\/9series.com\/blog\/adaptive-vs-responsive-web-design-difference-best-suitable-for-responsive-website-developers-designers-in-india\/\" target=\"_blank\">HTML5 Responsive web designer<\/a> know about customization tools like libraries, frameworks and API\u2019s. Meanwhile, in respect to CSS, it\u2019s no contrary and SASS win the race with its features like \u201cmixins.\u201d By creating a mixin, developers can group CSS declarations and reuse them throughout the file, without a lot of tedious coding.<\/p>\n<p>Instead of typing the same property over and over we write a mixin once then inherit whenever required.<\/p>\n<p>To declare, <span style=\"font-weight: bold\">@mixin<\/span> keyword is used followed by a rule <span style=\"font-weight: bold\">border-radius<\/span> and brackets which would have a variable for that rule <span style=\"font-weight: bold\">$radius.<\/span><\/p>\n<p><span style=\"font-weight: bold\">Here&#8217;s an example:<\/span><\/p>\n<p><span style=\"font-weight: bold\">SASS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\n@mixin border-radius($radius) {<br \/>\n-webkit-border-radius: $radius;<br \/>\n-moz-border-radius: $radius;<br \/>\n-ms-border-radius: $radius;<br \/>\nborder-radius: $radius;<br \/>\n}<br \/>\n.box { @include border-radius(10px); }<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>When defining a class for mixin, in this case it is .<span style=\"font-weight: bold\">box<\/span> then you need to use <span style=\"font-weight: bold\">\u201c@include\u201d<\/span> followed by a rule <span style=\"font-weight: bold\">\u201cborder-radius\u201d<\/span>.<\/p>\n<p><span style=\"font-weight: bold\">CSS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\n.box {<br \/>\n-webkit-border-radius: 10px;<br \/>\n-moz-border-radius: 10px;<br \/>\n-ms-border-radius: 10px;<br \/>\nborder-radius: 10px;<br \/>\n}<br \/>\n<\/code><\/p>\n<p><span style=\"font-weight: bold\">3) Make your CSS more organized with Nesting in SASS<\/span><\/p>\n<p>One more interesting feature with SASS is the ability to nest elements inside each other. When writing HTML you&#8217;ve probably noticed that it has a clear nested and visual hierarchy<br \/>\nCSS, doesn&#8217;t.<\/p>\n<p>Sass will let you nest your CSS selectors in a way that follows the same visual hierarchy of your HTML. But make sure that excessively nested rules will affect in CSS that could prove hard support and is generally considered bad practice.<\/p>\n<p><span style=\"font-weight: bold\">Here&#8217;s a nested example:<\/span><\/p>\n<p><span style=\"font-weight: bold\">SASS SYNTAX<\/span><\/p>\n<p><code><br \/>\nnav {<br \/>\nul {<br \/>\nmargin: 0;<br \/>\npadding: 0;<br \/>\nlist-style: none;<br \/>\n}<br \/>\nli { display: inline-block; }<br \/>\na {<br \/>\ndisplay: block;<br \/>\npadding: 6px 12px;<br \/>\ntext-decoration: none;<br \/>\n}<br \/>\n}<br \/>\n<\/code><\/p>\n<p><span style=\"font-weight: bold\">CSS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\nnav ul {<br \/>\nmargin: 0;<br \/>\npadding: 0;<br \/>\nlist-style: none;<br \/>\n}<br \/>\nnav li {<br \/>\ndisplay: inline-block;<br \/>\n}<br \/>\nnav a {<br \/>\ndisplay: block;<br \/>\npadding: 6px 12px;<br \/>\ntext-decoration: none;<br \/>\n}<br \/>\n<\/code><\/p>\n<p><span style=\"font-weight: bold\">4) Build your CSS even more modular and easier to work with<\/span><\/p>\n<p>The use of partials permits us an incredible approach to modularize our code, with a growing website the complexity increases which heads towards bigger CSS stylesheets but with SASS it makes it more portable and easier to maintain.<\/p>\n<p>A partial is simply a Sass file named with a leading underscore such as <span style=\"font-weight: bold\">_partial.scss<\/span> The underscore lets Sass know that the file is only a partial file and it should not be generated into a CSS file, however partials that are imported into the main scss file are compiled into the main css file and get converted into css syntax. Sass partials are used with the <span style=\"font-weight: bold\">@import<\/span> directive.<\/p>\n<p><span style=\"font-weight: bold\">Here&#8217;s an nested example:<\/span><\/p>\n<p><span style=\"font-weight: bold\">SASS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\n@import 'partial-file-name'; (this @import is written inside the main scss file)<br \/>\n<\/code><\/p>\n<p><span style=\"font-weight: bold\">5) @extend saves your time<\/span><\/p>\n<p>Here the word Inheritance plays a major role. One more time-saver concept especially beneficial to developers lets them share properties between selectors.<\/p>\n<p>Let&#8217;s make it simple in developing a website there are series of the button like login, sign up, save and edit which is of the same shape, size, rounded edges, color, and fonts. Maybe Login goes for green, place a call to yellow, make payment goes to red and so forth but all attributes go same throughout the website. All these attributes will be coded once and inherited with the <span style=\"font-weight: bold\">@extend<\/span> keyword for its use, which saves developers time.<\/p>\n<p>For example we&#8217;re going to create a simple series of buttons for login, sign up, save and edit<\/p>\n<p><span style=\"font-weight: bold\">SASS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\n.login {<br \/>\nborder: 1px solid #ccc;<br \/>\npadding: 10px;<br \/>\ncolor: #139016;<br \/>\n}<br \/>\n.signup{<br \/>\n@extend .login;<br \/>\nborder-color: green;<br \/>\n}<br \/>\n.save{<br \/>\n@extend .login;<br \/>\nborder-color: red;<br \/>\n}<br \/>\n.edit {<br \/>\n@extend .login;<br \/>\nborder-color: yellow;<br \/>\n}<br \/>\n<\/code><\/p>\n<p>What the above code does is it allows you to take the css properties in .login and apply them to .signup, .save &amp; .edit. Once the code is generated into css it then looks something like this:<\/p>\n<p><span style=\"font-weight: bold\">Here&#8217;s an example:<\/span><\/p>\n<p><span style=\"font-weight: bold\">CSS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\n.login, .signup, .save, .edit {<br \/>\nborder: 1px solid #cccccc;<br \/>\npadding: 10px;<br \/>\ncolor: #139016;<br \/>\n}<br \/>\n.signup {<br \/>\nborder-color: green;<br \/>\n}<br \/>\n.save {<br \/>\nborder-color: red;<br \/>\n}<br \/>\n.edit {<br \/>\nborder-color: yellow;<br \/>\n}<br \/>\n<\/code><\/p>\n<p><span style=\"font-weight: bold\">6) Do Math with SASS operators<\/span><\/p>\n<p>Sass permits you with the standard math functions like +,-,*, \/ and &amp;. Obviously, these functions can fuse to create complex estimations.<\/p>\n<p>The good news is Sass has a few built-in functions to help manipulate numbers. Functions like round(),percentage() , random(), floor(), round() etc.<\/p>\n<p><span style=\"font-weight: bold\">SASS SYNTAX<\/span><\/p>\n<p><code style=\"margin-top: 10px;font-size: 13px;line-height: 18px;color: #146c7c\"><br \/>\n.container { width: 100%; }<br \/>\narticle[role=\"main\"] {<br \/>\nfloat: left;<br \/>\nwidth: 600px \/ 960px * 100%;<br \/>\n}<br \/>\naside[role=\"complementary\"] {<br \/>\nfloat: right;<br \/>\nwidth: 300px \/ 960px * 100%;<br \/>\n}<br \/>\n<\/code><\/p>\n<p>Accordingly, we can conclude with CSS preprocessors that are impressive and help us to streamline our development process. While it gives the idea that Sass is popularly known for its feature-rich extensions which can make your CSS more maintainable, theme oriented and extendable. Browse our <a href=\"https:\/\/www.9series.com\/services\/html-web-development.html\" target=\"_blank\">HTML5 website developers<\/a> for your next development projects.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SASS, the Buzzing word is the realm of web development industry. You may scratch your head in surfing over the gigantic database of google to get a quickstart on the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5948,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"dsgo_overlay_header":false,"dsgo_overlay_header_text_color":"","dsgo_overlay_skip_top_bar":false,"_designsetgo_exclude_llms":false,"footnotes":""},"categories":[1438,1445],"tags":[1757,1906,1907,1908,1909,1910,1911,1912,1578],"class_list":["post-5947","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-graphic-designing","category-html5-developers","tag-css","tag-css-stylesheets","tag-front-end-developers","tag-graphic-designers","tag-html5-developers-in-india","tag-html5-responsive-web-designer","tag-html5-website-developers","tag-sass-developers","tag-web-development"],"_links":{"self":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/5947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/comments?post=5947"}],"version-history":[{"count":1,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/5947\/revisions"}],"predecessor-version":[{"id":5949,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/5947\/revisions\/5949"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/media\/5948"}],"wp:attachment":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/media?parent=5947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/categories?post=5947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/tags?post=5947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}