diff --git a/src/value/mod.rs b/src/value/mod.rs index f5c0942..87befa9 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -137,8 +137,13 @@ impl Value { ) .into()) } - // TODO: should to_css_string on function fail? - Self::Function(func) => format!("get-function(\"{}\")", func.name()), + Self::Function(..) => { + return Err(( + format!("{} isn't a valid CSS value.", self.inspect(span)?), + span, + ) + .into()) + } Self::List(vals, sep, brackets) => match brackets { Brackets::None => vals .iter() diff --git a/tests/get-function.rs b/tests/get-function.rs index 757b0ec..01297bf 100644 --- a/tests/get-function.rs +++ b/tests/get-function.rs @@ -99,3 +99,8 @@ error!( non_function_call, "a {color: call(4);}", "Error: $function: 4 is not a function reference." ); +error!( + emit_plain_get_function_is_invalid_css, + "a {color: get-function(lighten);}", + "Error: get-function(\"lighten\") isn't a valid CSS value." +);