{"id":237831,"date":"2016-02-09T07:26:59","date_gmt":"2016-02-09T14:26:59","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=237831"},"modified":"2016-02-09T07:26:59","modified_gmt":"2016-02-09T14:26:59","slug":"power-function","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/snippets\/sass\/power-function\/","title":{"rendered":"Power Function"},"content":{"rendered":"

While very helpful with arithmetic, Sass falls a bit short with mathematical helper functions. There has been an open issue<\/a> on the official repository to ask for more math-related functions for almost 3 years. <\/p>\n

Some third-party vendors like Compass<\/a> or SassyMath<\/a> provide advanced support for math features, but they are external dependencies which could (should?) be avoided.<\/p>\n

One of the most popular request on this matter is a power function or even a exponent operator<\/a>. Unfortunately, there is still no support for this in Sass and while it is still under active discussion, it is unlikely to happen very soon.<\/p>\n

Meanwhile, being able to raise a number to a certain power happens to be very useful in CSS. Here are a few examples where it would come in handy:<\/p>\n