Example #1
0
func getSassNumberUnit(arg UnionSassValue) (string, error) {
	u := C.GoString(C.sass_number_get_unit(arg))
	err := error(nil)

	if u == "" || u == "none" {
		err = fmt.Errorf("SassNumber has no units.")
	}

	if _, ok := sassUnitConversions[u]; !ok {
		err = fmt.Errorf("SassNumber units %s are unsupported", u)
	}

	return u, err
}
Example #2
0
func noSassNumberUnit(arg UnionSassValue) bool {
	return C.GoString(C.sass_number_get_unit(arg)) == "" || C.GoString(C.sass_number_get_unit(arg)) == "none"
}
Example #3
0
func Unit(usv UnionSassValue) string {
	c := C.sass_number_get_unit(usv)
	return C.GoString(c)
}