Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Pug
Pug

864
638
+ 1
386
Sass
Sass

11.2K
7.5K
+ 1
3K
Add tool

Pug vs Sass: What are the differences?

Pug: Robust, elegant, feature rich template engine for nodejs. This project was formerly known as "Jade." Pug is a high performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and browsers; Sass: Syntactically Awesome Style Sheets. Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance, and more. It's translated to well-formatted, standard CSS using the command line tool or a web-framework plugin.

Pug and Sass are primarily classified as "Templating Languages & Extensions" and "CSS Pre-processors / Extensions" tools respectively.

"Elegant html", "Great with nodejs" and "Open source" are the key factors why developers consider Pug; whereas "Variables", "Mixins" and "Nested rules" are the primary reasons why Sass is favored.

Pug and Sass are both open source tools. It seems that Pug with 18.3K GitHub stars and 1.9K forks on GitHub has more adoption than Sass with 12K GitHub stars and 1.93K GitHub forks.

StackShare, HubSpot, and thoughtbot are some of the popular companies that use Sass, whereas Pug is used by Sellsuki, triGo GmbH, and Key Location. Sass has a broader approval, being mentioned in 2082 company stacks & 1445 developers stacks; compared to Pug, which is listed in 173 company stacks and 118 developer stacks.

What is Pug?

This project was formerly known as "Jade." Pug is a high performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and browsers.

What is Sass?

Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance, and more. It's translated to well-formatted, standard CSS using the command line tool or a web-framework plugin.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose Pug?
Why do developers choose Sass?

Sign up to add, upvote and see more prosMake informed product decisions

    Be the first to leave a con
      Be the first to leave a con
      What companies use Pug?
      What companies use Sass?

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with Pug?
      What tools integrate with Sass?

      Sign up to get full access to all the tool integrationsMake informed product decisions

      What are some alternatives to Pug and Sass?
      TypeScript
      TypeScript is a language for application-scale JavaScript development. It's a typed superset of JavaScript that compiles to plain JavaScript.
      Handlebars.js
      Handlebars.js is an extension to the Mustache templating language created by Chris Wanstrath. Handlebars.js and Mustache are both logicless templating languages that keep the view and the code separated like we all know they should be.
      Mustache
      Mustache is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object. We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values.
      Hogan.js
      Hogan.js is a 3.4k JS templating engine developed at Twitter. Use it as a part of your asset packager to compile templates ahead of time or include it in your browser to handle dynamic templates.
      Smarty
      Facilitating the separation of presentation (HTML/CSS) from application logic. This implies that PHP code is application logic, and is separated from the presentation
      See all alternatives
      Decisions about Pug and Sass
      Koa
      Koa
      React Router
      React Router
      Foundation
      Foundation
      Semantic UI
      Semantic UI
      Bootstrap
      Bootstrap
      PostCSS
      PostCSS
      Less
      Less
      Sass
      Sass
      styled-components
      styled-components
      React Helmet
      React Helmet
      Webpack
      Webpack
      TypeScript
      TypeScript
      JavaScript
      JavaScript
      Apollo
      Apollo
      GraphQL
      GraphQL
      React
      React
      #JSX
      #React.
      #Css
      #StyledComponents.
      #Async
      #HTML
      #GraphQL
      #Apollo

      ReactQL is a React + GraphQL front-end starter kit. #JSX is a natural way to think about building UI, and it renders to pure #HTML in the browser and on the server, making it trivial to build server-rendered Single Page Apps. GraphQL via Apollo was chosen for the data layer; #GraphQL makes it simple to request just the data your app needs, and #Apollo takes care of communicating with your API (written in any language; doesn't have to be JavaScript!), caching, and rendering to #React.

      ReactQL is written in TypeScript to provide full types/Intellisense, and pick up hard-to-diagnose goofs that might later show up at runtime. React makes heavy use of Webpack 4 to handle transforming your code to an optimised client-side bundle, and in throws back just enough code needed for the initial render, while seamlessly handling import statements asynchronously as needed, making the payload your user downloads ultimately much smaller than trying to do it by hand.

      React Helmet was chosen to handle <head> content, because it works universally, making it easy to throw back the correct <title> and other tags on the initial render, as well as inject new tags for subsequent client-side views.

      styled-components, Sass, Less and PostCSS were added to give developers a choice of whether to build styles purely in React / JavaScript, or whether to defer to a #css #preprocessor. This is especially useful for interop with UI frameworks like Bootstrap, Semantic UI, Foundation, etc - ReactQL lets you mix and match #css and renders to both a static .css file during bundling as well as generates per-page <style> tags when using #StyledComponents.

      React Router handles routing, because it works both on the server and in the client. ReactQL customises it further by capturing non-200 responses on the server, redirecting or throwing back custom 404 pages as needed.

      Koa is the web server that handles all incoming HTTP requests, because it's fast (TTFB < 5ms, even after fully rendering React), and its natively #async, making it easy to async/await inside routes and middleware.

      See more
      Hampton Catlin
      Hampton Catlin
      VP of Engineering at Rent The Runway · | 4 upvotes · 53.9K views
      atRent the RunwayRent the Runway
      styled-components
      styled-components
      PostCSS
      PostCSS
      Sass
      Sass

      We use Sass because I invented it! No, that's not a joke at all! Well, let me explain. So, we used Sass before I started at Rent the Runway because it's the de-facto industry standard for pre-compiled and pre-processed CSS. We do also use PostCSS for stuff like vendor prefixing and various transformations, but Sass (specifically SCSS) is the main developer-focused language for describing our styling. Some internal apps use styled-components and @Aphrodite, but our main website is allllll Sassy. Oh, but the non-joking part is the inventing part. /shrug

      See more
      Ali Soueidan
      Ali Soueidan
      Creative Web Developer at Ali Soueidan · | 16 upvotes · 50.9K views
      npm
      npm
      Babel
      Babel
      PHP
      PHP
      Adobe Illustrator
      Adobe Illustrator
      Asana
      Asana
      ES6
      ES6
      GitHub
      GitHub
      Git
      Git
      JSON
      JSON
      Sass
      Sass
      Pug
      Pug
      JavaScript
      JavaScript
      vuex
      vuex
      Vue.js
      Vue.js

      Application and Data: Since my personal website ( https://alisoueidan.com ) is a SPA I've chosen to use Vue.js, as a framework to create it. After a short skeptical phase I immediately felt in love with the single file component concept! I also used vuex for state management, which makes working with several components, which are communicating with each other even more fun and convenient to use. Of course, using Vue requires using JavaScript as well, since it is the basis of it.

      For markup and style, I used Pug and Sass, since they’re the perfect match to me. I love the clean and strict syntax of both of them and even more that their structure is almost similar. Also, both of them come with an expanded functionality such as mixins, loops and so on related to their “siblings” (HTML and CSS). Both of them require nesting and prevent untidy code, which can be a huge advantage when working in teams. I used JSON to store data (since the data quantity on my website is moderate) – JSON works also good in combo with Pug, using for loops, based on the JSON Objects for example.

      To send my contact form I used PHP, since sending emails using PHP is still relatively convenient, simple and easy done.

      DevOps: Of course, I used Git to do my version management (which I even do in smaller projects like my website just have an additional backup of my code). On top of that I used GitHub since it now supports private repository for free accounts (which I am using for my own). I use Babel to use ES6 functionality such as arrow functions and so on, and still don’t losing cross browser compatibility.

      Side note: I used npm for package management. 🎉

      *Business Tools: * I use Asana to organize my project. This is a big advantage to me, even if I work alone, since “private” projects can get interrupted for some time. By using Asana I still know (even after month of not touching a project) what I’ve done, on which task I was at last working on and what still is to do. Working in Teams (for enterprise I’d take on Jira instead) of course Asana is a Tool which I really love to use as well. All the graphics on my website are SVG which I have created with Adobe Illustrator and adjusted within the SVG code or by using JavaScript or CSS (SASS).

      See more
      Interest over time
      Reviews of Pug and Sass
      No reviews found
      How developers use Pug and Sass
      Avatar of Kevin Ard
      Kevin Ard uses SassSass

      It was a little awkward building BS3 with LESS, and the rest of the site with SCSS, but it works. SCSS made building the UI elements (ink/flip buttons, img navs, etc) a breeze. It also drives the mobile menu open/close transitions - that would have been much too much with vanilla css.

      Avatar of Romans Malinovskis
      Romans Malinovskis uses PugPug
      Avatar of Climate CoLab
      Climate CoLab uses SassSass

      Sass helps us write better stylesheets. One major improvement over CSS that we use a lot is variables - it allows for much easier theming to quickly change brand colors for new instances of the xCoLab.

      Avatar of Ujjwal Bhujel
      Ujjwal Bhujel uses SassSass

      When you realise that countless lines of CSS codes could be made countable. And off course, a wonderful and cool way to use the logic behind variables and nesting. Simply love it.

      Avatar of Kalibrr
      Kalibrr uses PugPug

      We use Jade when writing HTML, which is much easier to read and maintain. We compile it to HTML before deploying it though, and don't use Jade's client-side rendering features.

      Avatar of Scrayos UG (haftungsbeschränkt)
      Scrayos UG (haftungsbeschränkt) uses SassSass

      Sass is used as a part of Woltlab Suite Core, which offers to submit/configure own styles via the injection of own Sass-CSS. So we exclusively rely on Sass for our CSS needs.

      Avatar of Refractal
      Refractal uses SassSass

      CSS is a mess. There, we said it. Sass, on the other hand takes CSS and makes it pretty, easy to work with and has stuff like variables which make things seriously awesome.

      Avatar of Merge In
      Merge In uses PugPug

      We use Jade for constructing our modular UI. We also rely on Jade interpolation to pass reactive and static values from our Express server.

      Avatar of Seungkwon Park
      Seungkwon Park uses PugPug

      front-end 수업 때 들은 jade 입니다. html을 효과적으로 다룰 수 있고

      로 열고 닫을때 혼돈이 없어 좋아합니다. 현재 프로젝트에 gulp와 함께 붙이려는 계획을 갖고 있지만, 아직 연습이 더 필요하다고 생각됩니다.
      Avatar of Mathias Vonende
      Mathias Vonende uses PugPug

      Nice templating system, but lacks proper namespacing for non-html / xml data.

      How much does Pug cost?
      How much does Sass cost?
      Pricing unavailable
      Pricing unavailable