Project

SassyCast

0.03
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Sass API for type conversion.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

SassyCast

SassyCast is a simple API for type conversion in Sass.

Installation

gem install SassyCast
bower install sassy-cast

Notes

SassCast has a strict mode in which it will throw errors when failing to cast values (most notably to colors and numbers). You can enable strict-mode with:

$sc-strict-mode: true;

In non-strict mode, when a value cannot be converted to a number, SassyCast will warn and return 0. You can change this value with:

$sc-non-strict-default-number: 0;

In non-strict mode, when a value cannot be converted to a color, SassyCast will warn and return transparent. You can change this value with:

$sc-non-strict-default-color: transparent;

Note that color formats are sometimes converted automatically by Sass depending on the type of syntaxe used (compressed, expanded, etc.). When casting a color to string, the resulting string can be different from the color input.

Credits

Huge thanks to Marc Mintel for his help.