@@ -304,52 +304,46 @@ pub fn extract_style_from_expression<'a>(
304304 Expression :: ComputedMemberExpression ( mem) => {
305305 extract_style_from_member_expression ( ast_builder, name, mem, level, selector)
306306 }
307- Expression :: TemplateLiteral ( _) => {
308- let name = name. unwrap ( ) ;
309- if typo {
310- ExtractResult {
311- styles : vec ! [ ExtractStyleProp :: Expression {
312- expression: ast_builder. expression_template_literal(
313- SPAN ,
314- ast_builder. vec_from_array( [
315- ast_builder. template_element(
316- SPAN ,
317- TemplateElementValue {
318- raw: ast_builder. atom( "typo-" ) ,
319- cooked: None ,
320- } ,
321- false ,
322- ) ,
323- ast_builder. template_element(
324- SPAN ,
325- TemplateElementValue {
326- raw: ast_builder. atom( "" ) ,
327- cooked: None ,
328- } ,
329- true ,
330- ) ,
331- ] ) ,
332- ast_builder
333- . vec_from_array( [ expression. clone_in( ast_builder. allocator) ] ) ,
334- ) ,
335- styles: vec![ ] ,
336- } ] ,
337- ..ExtractResult :: default ( )
338- }
307+ Expression :: TemplateLiteral ( _) => ExtractResult {
308+ styles : if typo {
309+ vec ! [ ExtractStyleProp :: Expression {
310+ expression: ast_builder. expression_template_literal(
311+ SPAN ,
312+ ast_builder. vec_from_array( [
313+ ast_builder. template_element(
314+ SPAN ,
315+ TemplateElementValue {
316+ raw: ast_builder. atom( "typo-" ) ,
317+ cooked: None ,
318+ } ,
319+ false ,
320+ ) ,
321+ ast_builder. template_element(
322+ SPAN ,
323+ TemplateElementValue {
324+ raw: ast_builder. atom( "" ) ,
325+ cooked: None ,
326+ } ,
327+ true ,
328+ ) ,
329+ ] ) ,
330+ ast_builder
331+ . vec_from_array( [ expression. clone_in( ast_builder. allocator) ] ) ,
332+ ) ,
333+ styles: vec![ ] ,
334+ } ]
339335 } else {
340- ExtractResult {
341- styles : vec ! [ ExtractStyleProp :: Static ( ExtractStyleValue :: Dynamic (
342- ExtractDynamicStyle :: new(
343- name,
344- level,
345- & expression_to_code( expression) ,
346- selector. clone( ) ,
347- ) ,
348- ) ) ] ,
349- ..ExtractResult :: default ( )
350- }
351- }
352- }
336+ vec ! [ ExtractStyleProp :: Static ( ExtractStyleValue :: Dynamic (
337+ ExtractDynamicStyle :: new(
338+ name. unwrap( ) ,
339+ level,
340+ & expression_to_code( expression) ,
341+ selector. clone( ) ,
342+ ) ,
343+ ) ) ]
344+ } ,
345+ ..ExtractResult :: default ( )
346+ } ,
353347 Expression :: Identifier ( identifier) => {
354348 if IGNORED_IDENTIFIERS . contains ( & identifier. name . as_str ( ) ) {
355349 ExtractResult :: default ( )
0 commit comments