{"id":404,"date":"2015-04-07T15:06:46","date_gmt":"2015-04-07T15:06:46","guid":{"rendered":"https:\/\/ionic.io\/blog\/?p=404"},"modified":"2015-12-16T19:41:20","modified_gmt":"2015-12-16T19:41:20","slug":"fixing-a-broken-sass-build-stream","status":"publish","type":"post","link":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream","title":{"rendered":"Fixing a Broken SASS Build Stream"},"content":{"rendered":"<p>Customizing your Ionic app with SASS can easily change its look and feel, but it can also create some problems. One particular problem can be syntax issues breaking your build stream. In this article, we&#8217;ll look at a quick and easy fix for this problem.<br \/>\n<!--more--><\/p>\n<h3>Let&#8217;s Break Things<\/h3>\n<p>First, let&#8217;s create a project with SASS already set up for us.<\/p>\n<pre><code class=\"bash\">$ ionic start myApp --sass\n$ cd myApp\n<\/code><\/pre>\n<p>From here, let&#8217;s up open up the project in our editor and then start our live reload server. With the server running, we can start to edit our <code>ionic.app.scss<\/code> file and make any changes we want, but for our example, we&#8217;re going to break things. We&#8217;ll copy the <code>$stable<\/code> variable and change its value.<\/p>\n<pre><code class=\"css\">\/*\nTo customize the look and feel of Ionic, you can override the variables\nin Ionic&#039;s _variables.scss file.\n\nFor example, you might change some of the default colors:\n\n$light:                           #fff !default;\n$stable:                          #f8f8f8 !default;\n$positive:                        #387ef5 !default;\n$calm:                            #11c1f3 !default;\n$balanced:                        #33cd5f !default;\n$energized:                       #ffc900 !default;\n$assertive:                       #ef473a !default;\n$royal:                           #886aea !default;\n$dark:                            #444 !default;\n*\/\n\n$stable:                          #34495e !default\n\/\/ The path for our Ionicons font files, relative to the built CSS in www\/css\n$ionicons-font-path: &quot;..\/lib\/ionic\/fonts&quot; !default;\n\n\/\/ Include all of Ionic\n@import &quot;www\/lib\/ionic\/scss\/ionic&quot;;\n\n<\/code><\/pre>\n<p>We&#8217;ve also forgotten to add a semicolon at the end of the variable, which will cause a syntax error and print out this error in our console.<\/p>\n<pre><code class=\"bash\">ionic $ [16:57:36] Using gulpfile ~\/myApp\/gulpfile.js\n[16:57:36] Starting &#039;sass&#039;...\n[16:57:36] Starting &#039;watch&#039;...\n[16:57:36] Finished &#039;watch&#039; after 6.05 ms\n\nstream.js:94\n      throw er; \/\/ Unhandled stream error in pipe.\n            ^\nError: top-level variable binding must be terminated by &#039;;&#039;\n<\/code><\/pre>\n<p>So let&#8217;s go back and add that semicolon. Once we have, we can save the file and expect to compile the Sass, but in this case, it won&#8217;t compile. The syntax error will completely break the gulp build stream. This can be incredibly problematic and just plain annoying when developing your app. Thankfully, it&#8217;s easy to fix.<\/p>\n<h3>Can we fix it? Yes, we can!<\/h3>\n<p>To fix the problem, we can open up our <code>gulpfile.js<\/code> and pass in an option to our SASS task.<\/p>\n<pre><code class=\"javascript\">gulp.task(&#039;sass&#039;, function(done) {\n  gulp.src(&#039;.\/scss\/ionic.app.scss&#039;)\n    .pipe(sass({errLogToConsole: true}))\n    .pipe(gulp.dest(&#039;.\/www\/css\/&#039;))\n    .pipe(minifyCss({\n      keepSpecialComments: 0\n    }))\n    .pipe(rename({ extname: &#039;.min.css&#039; }))\n    .pipe(gulp.dest(&#039;.\/www\/css\/&#039;))\n    .on(&#039;end&#039;, done);\n});\n<\/code><\/pre>\n<p>Adding <code>{errLogToConsole: true}<\/code> to the SASS method will allow us to log out any errors to our console and keep our build stream from breaking. Now, we can continue working with our SASS files, be notified of any syntax errors, and keep our live reload server from breaking.<\/p>\n<div class=\"video-container\">\n              <iframe data-src=\"https:\/\/www.youtube.com\/embed\/OgPz4tcoD7o\"frameborder=\"0\" allowfullscreen src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n            <\/div>\n<p><a href=\"https:\/\/github.com\/dlmanning\/gulp-sass\">Gulp-SASS Docs<\/a><\/p>\n<p><a href=\"http:\/\/sass-lang.com\/documentation\/\">SASS Docs<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/gulpjs\/gulp\/blob\/master\/docs\/getting-started.md\">Gulp Docs<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Customizing your Ionic app with SASS can easily change its look and feel, but it can also create some problems. One particular problem can be syntax issues breaking your build stream. In this article, we&#8217;ll look at a quick and easy fix for this problem.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"publish_to_discourse":"","publish_post_category":"","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"","discourse_permalink":"","wpdc_publishing_response":"","wpdc_publishing_error":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[3],"class_list":["post-404","post","type-post","status-publish","format-standard","hentry","category-all","tag-ionic"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fixing a Broken SASS Build Stream - Ionic Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fixing a Broken SASS Build Stream\" \/>\n<meta property=\"og:description\" content=\"Customizing your Ionic app with SASS can easily change its look and feel, but it can also create some problems. One particular problem can be syntax issues breaking your build stream. In this article, we&#8217;ll look at a quick and easy fix for this problem.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream\" \/>\n<meta property=\"og:site_name\" content=\"Ionic Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-04-07T15:06:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-16T19:41:20+00:00\" \/>\n<meta name=\"author\" content=\"Mike Hartington\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mhartington\" \/>\n<meta name=\"twitter:site\" content=\"@ionicframework\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Hartington\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream#article\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream\"},\"author\":{\"name\":\"Mike Hartington\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/c8c92b04d526adb925ea514c619a267b\"},\"headline\":\"Fixing a Broken SASS Build Stream\",\"datePublished\":\"2015-04-07T15:06:46+00:00\",\"dateModified\":\"2015-12-16T19:41:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream\"},\"wordCount\":299,\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"keywords\":[\"Ionic\"],\"articleSection\":[\"All\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream\",\"url\":\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream\",\"name\":\"Fixing a Broken SASS Build Stream - Ionic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/#website\"},\"datePublished\":\"2015-04-07T15:06:46+00:00\",\"dateModified\":\"2015-12-16T19:41:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ionic.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fixing a Broken SASS Build Stream\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ionic.io\/blog\/#website\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"name\":\"ionic.io\/blog\",\"description\":\"Build amazing native and progressive web apps with the web\",\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ionic.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ionic.io\/blog\/#organization\",\"name\":\"Ionic\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"width\":1920,\"height\":854,\"caption\":\"Ionic\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/ionicframework\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/c8c92b04d526adb925ea514c619a267b\",\"name\":\"Mike Hartington\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/08\/mike-headshot-2-smaller-150x150.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/08\/mike-headshot-2-smaller-150x150.png\",\"caption\":\"Mike Hartington\"},\"description\":\"Director of Developer Relations\",\"sameAs\":[\"https:\/\/twitter.com\/mhartington\",\"https:\/\/x.com\/mhartington\"],\"url\":\"https:\/\/ionic.io\/blog\/author\/mike\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fixing a Broken SASS Build Stream - Ionic Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream","og_locale":"en_US","og_type":"article","og_title":"Fixing a Broken SASS Build Stream","og_description":"Customizing your Ionic app with SASS can easily change its look and feel, but it can also create some problems. One particular problem can be syntax issues breaking your build stream. In this article, we&#8217;ll look at a quick and easy fix for this problem.","og_url":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream","og_site_name":"Ionic Blog","article_published_time":"2015-04-07T15:06:46+00:00","article_modified_time":"2015-12-16T19:41:20+00:00","author":"Mike Hartington","twitter_card":"summary_large_image","twitter_creator":"@mhartington","twitter_site":"@ionicframework","twitter_misc":{"Written by":"Mike Hartington","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream#article","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream"},"author":{"name":"Mike Hartington","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/c8c92b04d526adb925ea514c619a267b"},"headline":"Fixing a Broken SASS Build Stream","datePublished":"2015-04-07T15:06:46+00:00","dateModified":"2015-12-16T19:41:20+00:00","mainEntityOfPage":{"@id":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream"},"wordCount":299,"publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"keywords":["Ionic"],"articleSection":["All"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream","url":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream","name":"Fixing a Broken SASS Build Stream - Ionic Blog","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/#website"},"datePublished":"2015-04-07T15:06:46+00:00","dateModified":"2015-12-16T19:41:20+00:00","breadcrumb":{"@id":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ionic.io\/blog\/fixing-a-broken-sass-build-stream#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ionic.io\/blog"},{"@type":"ListItem","position":2,"name":"Fixing a Broken SASS Build Stream"}]},{"@type":"WebSite","@id":"https:\/\/ionic.io\/blog\/#website","url":"https:\/\/ionic.io\/blog\/","name":"ionic.io\/blog","description":"Build amazing native and progressive web apps with the web","publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ionic.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ionic.io\/blog\/#organization","name":"Ionic","url":"https:\/\/ionic.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","width":1920,"height":854,"caption":"Ionic"},"image":{"@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ionicframework"]},{"@type":"Person","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/c8c92b04d526adb925ea514c619a267b","name":"Mike Hartington","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/08\/mike-headshot-2-smaller-150x150.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/08\/mike-headshot-2-smaller-150x150.png","caption":"Mike Hartington"},"description":"Director of Developer Relations","sameAs":["https:\/\/twitter.com\/mhartington","https:\/\/x.com\/mhartington"],"url":"https:\/\/ionic.io\/blog\/author\/mike"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/comments?post=404"}],"version-history":[{"count":0,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/404\/revisions"}],"wp:attachment":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media?parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/categories?post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/tags?post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}