Example #1
0
func getSassNumberUnit(arg SassValue) (string, error) {
	u := libs.Unit(arg.Val())
	var err error
	if noSassNumberUnit(arg) {
		return u, ErrSassNumberNoUnit
	}
	if _, ok := libs.SassUnitConversions[u]; !ok {
		return u, fmt.Errorf("SassNumber units %s are unsupported", u)
	}
	return u, err
}
Example #2
0
func noSassNumberUnit(arg SassValue) bool {
	u := libs.Unit(arg.Val())
	return u == "" || u == "none"
}