Skip to content

Instantly share code, notes, and snippets.

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

Credit Cards

mastercard = "^5[1-5][0-9]{14}$"
visaCredit = "^4[0-9]{12}(?:[0-9]{3})?$"
amex = "^3[47][0-9]{13}$"
Diners = "^3(?:0[0-5]|[68][0-9])[0-9]{11}$"
Discover = "^6(?:011|5[0-9]{2})[0-9]{12}$"
JCB = "^(?:2131|1800|35\d{3})\d{11}$"