{"id":38100,"date":"2016-07-29T15:24:10","date_gmt":"2016-07-29T09:54:10","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=38100"},"modified":"2016-07-29T15:24:10","modified_gmt":"2016-07-29T09:54:10","slug":"sass-imports-with-sass-globbing","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/sass-imports-with-sass-globbing\/","title":{"rendered":"Sass Imports with Sass Globbing"},"content":{"rendered":"<p>If we are using Sass to preprocess stylesheets, we must have knowledge about partials. A partial is a sub-stylesheet, intended to be included as part of a main stylesheet. So as to avoid adding \u201cpartials\u201d every time, we can use the sass-globbing gem to remove the extra overhead.<\/p>\n<h3>Sass Globbing to rescue<\/h3>\n<p><span>Sass-globbing is a Ruby gem for Sass. It lets us import directories or whole directory trees with a single @import statement:<\/span><br \/>\n<span>Instead of including absolute paths for eg:<\/span><\/p>\n<p>[html]<br \/>\n\/\/ Modules and Variables<br \/>\n@import &quot;partials\/base&quot;;<br \/>\n\/\/ Partials<br \/>\n@import &quot;partials\/reset&quot;;<br \/>\n@import &quot;partials\/typography&quot;;<br \/>\n@import &quot;partials\/buttons&quot;;<\/p>\n<p>[\/html]<br \/>\nWe can do something like this:<br \/>\n[html]<br \/>\n@import &quot;partials\/*&quot;;<br \/>\n@import &quot;partials\/**\/*&quot;<\/p>\n<p>[\/html]<br \/>\n<span>The first one includes all the files in the partials folder.<\/span><br \/>\n<span>The second one includes all the files in the partials folder recursively.<\/span><\/p>\n<p>To start using the gem, we\u2019ll install it from the command line:<\/p>\n<p>[html]<br \/>\n$ gem install sass-globbing<br \/>\n[\/html]<\/p>\n<p>after this installation we can easily import the partials folder.<\/p>\n<h3>Usage of Sass command line<\/h3>\n<p><span>When we are using scss global plugin then we convert scss to css using below command:<\/span><br \/>\n[html]<br \/>\n$ sass -r sass-globbing &#8211;watch sass_dir:css_dir<br \/>\n[\/html]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If we are using Sass to preprocess stylesheets, we must have knowledge about partials. A partial is a sub-stylesheet, intended to be included as part of a main stylesheet. So as to avoid adding \u201cpartials\u201d every time, we can use the sass-globbing gem to remove the extra overhead. Sass Globbing to rescue Sass-globbing is a [&hellip;]<\/p>\n","protected":false},"author":920,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":19},"categories":[1],"tags":[3828,3829],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/38100"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/920"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=38100"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/38100\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=38100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=38100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=38100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}