{"id":15409,"date":"2012-11-09T21:01:31","date_gmt":"2012-11-09T13:01:31","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=15409"},"modified":"2025-04-04T01:14:16","modified_gmt":"2025-04-03T17:14:16","slug":"saas-compass","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/","title":{"rendered":"Maximize Your CSS with Compass and Sass"},"content":{"rendered":"<p>In <a href=\"https:\/\/www.hongkiat.com\/blog\/getting-started-saas\/\">our last post<\/a>, we mentioned <a href=\"http:\/\/compass-style.org\/\" rel=\"nofollow noopener\" target=\"_blank\">Compass<\/a>, an <strong>open-source CSS Authoring Framework<\/strong> that enhances your workflow.<\/p>\n<p>Compass is a powerful extension for Sass, much like the <a href=\"https:\/\/lesscss.org\/\" rel=\"nofollow noopener\" target=\"_blank\">LESS Element<\/a> for <a href=\"https:\/\/lesscss.org\/\" rel=\"nofollow noopener\" target=\"_blank\">LESS<\/a>. It offers a robust collection of ready-to-use CSS3 Mixins and additional tools that make it an indispensable companion for <a href=\"https:\/\/sass-lang.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Sass<\/a>. Let\u2019s explore its capabilities.<\/p>\n<h2>How to Install Compass<\/h2>\n<p>Compass, like <a href=\"https:\/\/sass-lang.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Sass<\/a>, <strong>needs to be installed on your system<\/strong>. However, if you are using an application like <a href=\"https:\/\/github.com\/mhs\/scout-app\" rel=\"nofollow noopener\" target=\"_blank\">Scout App<\/a> or <a href=\"https:\/\/compass.kkbox.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Compass.app<\/a>, this step is not required.<\/p>\n<p>If you\u2019re not using these applications, you can install Compass manually via the <strong>Terminal\/Command Prompt<\/strong> by entering the following commands:<\/p>\n<p><strong>On Mac\/Linux Terminal<\/strong><\/p>\n<pre>\r\nsudo gem install compass\r\n<\/pre>\n<p><strong>On Windows Command Prompt<\/strong><\/p>\n<pre>\r\ngem install compass\r\n<\/pre>\n<p>After a successful installation, you\u2019ll receive a notification like the one shown below:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/installing-compass.jpg\" width=\"500\" height=\"234\" alt=\"Successful installation of Compass on Terminal\"><\/figure>\n<p>Next, navigate to your working directory and run the following command to initialize a <strong>Compass project<\/strong>:<\/p>\n<pre>\r\ncompass init\r\n<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/compass-init.jpg\" width=\"500\" height=\"280\" alt=\"Running compass init command in Terminal\"><\/figure>\n<p><strong>Further Reading<\/strong>: <a href=\"http:\/\/compass-style.org\/help\/documentation\/command-line\/\" rel=\"nofollow noopener\" target=\"_blank\">Compass Command Line Documentation<\/a><\/p>\n<h2>Configuring Compass<\/h2>\n<p>After running the <code>compass init<\/code> command, a file named <code>config.rb<\/code> will be created in your working directory. This file is used to configure the project\u2019s output settings, such as preferred directory names.<\/p>\n<pre>\r\nhttp_path = \"\/\"\r\ncss_dir = \"css\"\r\nsass_dir = \"scss\"\r\nimages_dir = \"img\"\r\njavascripts_dir = \"js\"\r\n<\/pre>\n<p>Remove any comment lines generated by Compass, and set <code>line_comments<\/code> to <code>false<\/code> if you don\u2019t want them included in the output CSS.<\/p>\n<pre>\r\nline_comments = false\r\n<\/pre>\n<p>You can also choose the CSS output style from four options: <code>:expanded<\/code>, <code>:compact<\/code>, <code>:compressed<\/code>, and <code>:nested<\/code>. For development, it\u2019s usually best to keep it <code>:expanded<\/code>.<\/p>\n<pre>\r\noutput_style = :expanded\r\n<\/pre>\n<p>These configurations should suffice for most projects. For more options, refer to the <a href=\"http:\/\/compass-style.org\/help\/documentation\/command-line\/\" rel=\"nofollow noopener\" target=\"_blank\">Compass Configuration Reference<\/a>.<\/p>\n<p>Finally, to monitor changes in your files, use the following command:<\/p>\n<pre>\r\ncompass watch\r\n<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/compass-watch.jpg\" width=\"500\" height=\"280\" alt=\"Compass watch command in Terminal\"><\/figure>\n<p>This command works similarly to Sass\u2019s <code>watch<\/code> command, tracking changes and updating the CSS files accordingly. Make sure to run this command after configuring your project in <code>config.rb<\/code> to ensure all changes are recognized.<\/p>\n<h2>Leveraging CSS3 Mixins<\/h2>\n<p>Before diving into CSS3, import Compass into your main <code>.scss<\/code> file with the following line:<\/p>\n<pre>\r\n@import \"compass\";\r\n<\/pre>\n<p>This imports all of Compass\u2019s extensions. However, if you only need the CSS3 mixins, you can specifically import them with:<\/p>\n<pre>\r\n@import \"compass\/css3\";\r\n<\/pre>\n<p><strong>Further Reading<\/strong>: <a href=\"http:\/\/compass-style.org\/reference\/compass\/css3\/\" rel=\"nofollow noopener\" target=\"_blank\">Compass CSS3<\/a><\/p>\n<p>Now, let\u2019s create something with Sass and Compass. Start with a simple HTML document:<\/p>\n<pre>\r\n&lt;section&gt;\r\n    &lt;div&gt;&lt;\/div&gt;\r\n&lt;\/section&gt;\r\n<\/pre>\n<p>We will create a rotated box with rounded corners using the following Sass code:<\/p>\n<pre>\r\nbody {\r\n    background-color: #f3f3f3;\r\n}\r\n\r\nsection {\r\n    width: 500px;\r\n    margin: 50px auto 0;\r\n\r\n    div {\r\n        width: 250px;\r\n        height: 250px;\r\n        background-color: #ccc;\r\n        margin: 0 auto;\r\n        @include border-radius;\r\n    }\r\n}\r\n<\/pre>\n<p>The <code>border-radius<\/code> mixin generates all the necessary browser prefixes. By default, it sets the corner radius to <code>5px<\/code>, but you can customize the radius like this: <code>@include border-radius(10px);<\/code>.<\/p>\n<pre>\r\nsection div {\r\n    width: 250px;\r\n    height: 250px;\r\n    background-color: #ccc;\r\n    margin: 0 auto;\r\n    -webkit-border-radius: 10px;\r\n    -moz-border-radius: 10px;\r\n    -ms-border-radius: 10px;\r\n    -o-border-radius: 10px;\r\n    border-radius: 10px;\r\n}\r\n<\/pre>\n<p>Next, let\u2019s rotate the box. With Compass, this is easy; just call the transformation method like this:<\/p>\n<pre>\r\nbody {\r\n    background-color: #f3f3f3;\r\n}\r\nsection {\r\n    width: 500px;\r\n    margin: 50px auto 0;\r\n\r\n    div {\r\n        width: 250px;\r\n        height: 250px;\r\n        background-color: #ccc;\r\n        margin: 0 auto;\r\n        @include border-radius(10px);\r\n        @include rotate;\r\n    }\r\n}\r\n<\/pre>\n<p>This mixin automatically generates the vendor prefixes needed for rotation, which defaults to 45 degrees. Here\u2019s the generated CSS:<\/p>\n<pre>\r\nsection div {\r\n    width: 250px;\r\n    height: 250px;\r\n    background-color: #ccc;\r\n    margin: 0 auto;\r\n    -webkit-border-radius: 10px;\r\n    -moz-border-radius: 10px;\r\n    -ms-border-radius: 10px;\r\n    -o-border-radius: 10px;\r\n    border-radius: 10px;\r\n    -webkit-transform: rotate(45deg);\r\n    -moz-transform: rotate(45deg);\r\n    -ms-transform: rotate(45deg);\r\n    -o-transform: rotate(45deg);\r\n    transform: rotate(45deg);\r\n}\r\n<\/pre>\n<h2>Explore Compass Helpers<\/h2>\n<p>One of the standout features of Compass is its <a href=\"http:\/\/compass-style.org\/reference\/compass\/helpers\/\" rel=\"nofollow noopener\" target=\"_blank\">Helpers<\/a>. These functions extend the <a href=\"https:\/\/sass-lang.com\/docs\/yardoc\/Sass\/Script\/Functions.html\" rel=\"nofollow noopener\" target=\"_blank\">capabilities of Sass functions<\/a>. Let\u2019s explore some practical examples.<\/p>\n<h3>Adding @Font-face Files<\/h3>\n<p>Here, we\u2019ll <a href=\"https:\/\/www.hongkiat.com\/blog\/typography-for-modern-websites\/\">add a custom font family<\/a> using the <code>@font-face<\/code> rule. In plain <a href=\"https:\/\/www.hongkiat.com\/blog\/beginners-guide-to-css3\/\">CSS3<\/a>, the code would look like this, including four different font types:<\/p>\n<pre>\r\n@font-face {\r\n    font-family: \"MyFont\";\r\n    src: url('\/fonts\/font.ttf') format('truetype'),\r\n         url('\/fonts\/font.otf') format('opentype'),\r\n         url('\/fonts\/font.woff') format('woff'),\r\n         url('\/fonts\/font.eot') format('embedded-opentype');\r\n}\r\n<\/pre>\n<p><strong>With Compass<\/strong>, the same result is achieved more easily using the <a href=\"http:\/\/compass-style.org\/reference\/compass\/helpers\/font-files\/\" rel=\"nofollow noopener\" target=\"_blank\"><code>font-files()<\/code> helper<\/a>:<\/p>\n<pre>\r\n@include font-face(\"MyFont\", font-files(\"font.ttf\", \"font.otf\", \"font.woff\", \"font.eot\"));\r\n<\/pre>\n<p>This code generates the same output as the manual method, automatically detecting the font type and adding it to the <code>format()<\/code> syntax.<\/p>\n<p>You may notice that the font path (<code>\/fonts\/<\/code>) is not specified. Compass derives this path from the <code>config.rb<\/code> file using the <code>fonts_path<\/code> property:<\/p>\n<pre>\r\nfonts_dir = \"fonts\"\r\n<\/pre>\n<p>If you change it to <code>fonts_dir = \"myfonts\"<\/code>, the generated code will be <code>url('\/myfonts\/font.ttf')<\/code>. By default, Compass points to <code>stylesheets\/fonts<\/code> if no path is specified.<\/p>\n<h3>Adding Images<\/h3>\n<p>Now, let\u2019s look at adding images. Typically, you would use the <code>background-image<\/code> property like this:<\/p>\n<pre>\r\ndiv {\r\n    background-image: url('\/img\/the-image.png');\r\n}\r\n<\/pre>\n<p>With Compass, you can replace the <code>url()<\/code> function with the <a href=\"http:\/\/compass-style.org\/reference\/compass\/helpers\/urls\/#image-url\" rel=\"nofollow noopener\" target=\"_blank\"><code>image-url()<\/code> helper<\/a>, allowing Compass to manage the path for you.<\/p>\n<pre>\r\ndiv {\r\n    background-image: image-url(the-image.png);\r\n}\r\n<\/pre>\n<p>Compass also offers <a href=\"http:\/\/compass-style.org\/reference\/compass\/helpers\/image-dimensions\/\" rel=\"nofollow noopener\" target=\"_blank\">Image Dimension Helpers<\/a>, which can automatically detect an image\u2019s width and height. If you need to specify these dimensions in your CSS, you can do so as follows:<\/p>\n<pre>\r\ndiv {\r\n    background-image: image-url(\"images.png\");\r\n    width: image-width(\"images.png\");\r\n    height: image-height(\"images.png\"); \r\n}\r\n<\/pre>\n<p>The generated output will look like this:<\/p>\n<pre>\r\ndiv {\r\n    background-image: url('\/img\/images.png?1344774650');\r\n    width: 80px;\r\n    height: 80px;\r\n}\r\n<\/pre>\n<p><strong>Further Reading<\/strong>: <a href=\"http:\/\/compass-style.org\/reference\/compass\/helpers\/\" rel=\"nofollow noopener\" target=\"_blank\">Compass Helper Functions<\/a><\/p>\n<h2>Final Thoughts<\/h2>\n<p>We\u2019ve covered a lot about Compass today, and as you can see, it\u2019s an incredibly powerful tool that allows us to write CSS more elegantly and efficiently.<\/p>\n<p>While Sass is a fantastic <strong>CSS preprocessor<\/strong>, it\u2019s not the only one available. LESS is another option, which we\u2019ve also <a href=\"https:\/\/www.hongkiat.com\/blog\/tag\/less\/\">discussed extensively<\/a>. In our next post, we\u2019ll compare Sass and LESS to determine which one offers the best features for preprocessing CSS.<\/p>\n<p><a href=\"https:\/\/github.com\/hongkiat\/saas-compass\/\" class=\"su-button su-button-style-flat\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:0px\" target=\"__blank\" rel=\"noopener nofollow\"><span style=\"color:#FFFFFF;padding:7px 20px;font-size:16px;line-height:24px;border-color:#6cadf4;border-radius:0px;text-shadow:none\"><i class=\"sui sui-external-link\" style=\"font-size:16px;color:#fff\"><\/i>  Download Source <\/span><\/a> <\/p>","protected":false},"excerpt":{"rendered":"<p>In our last post, we mentioned Compass, an open-source CSS Authoring Framework that enhances your workflow. Compass is a powerful extension for Sass, much like the LESS Element for LESS. It offers a robust collection of ready-to-use CSS3 Mixins and additional tools that make it an indispensable companion for Sass. Let\u2019s explore its capabilities. How&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3392,352],"tags":[507,2190],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Maximize Your CSS with Compass and Sass - Hongkiat<\/title>\n<meta name=\"description\" content=\"In our last post, we mentioned Compass, an open-source CSS Authoring Framework that enhances your workflow. Compass is a powerful extension for Sass, much\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/saas-compass\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Maximize Your CSS with Compass and Sass\" \/>\n<meta property=\"og:description\" content=\"In our last post, we mentioned Compass, an open-source CSS Authoring Framework that enhances your workflow. Compass is a powerful extension for Sass, much\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/saas-compass\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2012-11-09T13:01:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:14:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/installing-compass.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"Maximize Your CSS with Compass and Sass\",\"datePublished\":\"2012-11-09T13:01:31+00:00\",\"dateModified\":\"2025-04-03T17:14:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/\"},\"wordCount\":716,\"commentCount\":17,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/saas-compass\\\/installing-compass.jpg\",\"keywords\":[\"CSS\",\"sass\"],\"articleSection\":[\"Coding\",\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/\",\"name\":\"Maximize Your CSS with Compass and Sass - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/saas-compass\\\/installing-compass.jpg\",\"datePublished\":\"2012-11-09T13:01:31+00:00\",\"dateModified\":\"2025-04-03T17:14:16+00:00\",\"description\":\"In our last post, we mentioned Compass, an open-source CSS Authoring Framework that enhances your workflow. Compass is a powerful extension for Sass, much\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/saas-compass\\\/installing-compass.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/saas-compass\\\/installing-compass.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/saas-compass\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Maximize Your CSS with Compass and Sass\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Maximize Your CSS with Compass and Sass - Hongkiat","description":"In our last post, we mentioned Compass, an open-source CSS Authoring Framework that enhances your workflow. Compass is a powerful extension for Sass, much","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:\/\/www.hongkiat.com\/blog\/saas-compass\/","og_locale":"en_US","og_type":"article","og_title":"Maximize Your CSS with Compass and Sass","og_description":"In our last post, we mentioned Compass, an open-source CSS Authoring Framework that enhances your workflow. Compass is a powerful extension for Sass, much","og_url":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2012-11-09T13:01:31+00:00","article_modified_time":"2025-04-03T17:14:16+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/installing-compass.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"Maximize Your CSS with Compass and Sass","datePublished":"2012-11-09T13:01:31+00:00","dateModified":"2025-04-03T17:14:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/"},"wordCount":716,"commentCount":17,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/installing-compass.jpg","keywords":["CSS","sass"],"articleSection":["Coding","Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/saas-compass\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/","url":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/","name":"Maximize Your CSS with Compass and Sass - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/installing-compass.jpg","datePublished":"2012-11-09T13:01:31+00:00","dateModified":"2025-04-03T17:14:16+00:00","description":"In our last post, we mentioned Compass, an open-source CSS Authoring Framework that enhances your workflow. Compass is a powerful extension for Sass, much","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/saas-compass\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/installing-compass.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/saas-compass\/installing-compass.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/saas-compass\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Maximize Your CSS with Compass and Sass"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-40x","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=15409"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15409\/revisions"}],"predecessor-version":[{"id":73557,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15409\/revisions\/73557"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=15409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=15409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=15409"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=15409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}