File tree Expand file tree Collapse file tree 4 files changed +21
-15
lines changed
tests/fixture/css-prop-in-exported-component Expand file tree Collapse file tree 4 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " next-yak " : patch
3+ " yak-swc " : patch
4+ ---
5+
6+ Fix issue with the css prop where it wouldn't be generated when used inside an exported component
Original file line number Diff line number Diff line change @@ -218,17 +218,6 @@ impl YakTransform for TransformCssMixin {
218218 ) ;
219219 }
220220 let css_prefix = match ( self . is_exported , self . is_within_jsx_attribute ) {
221- ( true , _) => Some ( format ! (
222- "YAK EXPORTED MIXIN:{}" ,
223- self
224- . export_name
225- . as_ref( )
226- . unwrap( )
227- . parts
228- . iter( )
229- . map( |atom| encode_percent( atom. as_str( ) ) )
230- . join( ":" )
231- ) ) ,
232221 ( _, true ) => {
233222 // Add the class name to the arguments, to be created by the CSS loader
234223 arguments. push (
@@ -241,6 +230,17 @@ impl YakTransform for TransformCssMixin {
241230 ) ;
242231 Some ( "YAK Extracted CSS:" . to_string ( ) )
243232 }
233+ ( true , _) => Some ( format ! (
234+ "YAK EXPORTED MIXIN:{}" ,
235+ self
236+ . export_name
237+ . as_ref( )
238+ . unwrap( )
239+ . parts
240+ . iter( )
241+ . map( |atom| encode_percent( atom. as_str( ) ) )
242+ . join( ":" )
243+ ) ) ,
244244 _ => None ,
245245 } ;
246246 YakTransformResult {
Original file line number Diff line number Diff line change 11import { css , __yak_mergeCssProp } from "next-yak/internal" ;
22import __styleYak from "./input.yak.module.css!=!./input?./input.yak.module.css" ;
3- export const YakLogo = ( ) => < div { .../*YAK EXPORTED MIXIN:YakLogo
3+ export const YakLogo = ( ) => < div { .../*YAK Extracted CSS:
44.YakLogo {
55 display: flex;
66 gap: 6px;
77}
8- */ /*#__PURE__*/ css ( ) ( { } ) } >
8+ */ /*#__PURE__*/ css ( __styleYak . YakLogo ) ( { } ) } >
99 Yak
1010 </ div > ;
Original file line number Diff line number Diff line change 11import { css , __yak_mergeCssProp } from "next-yak/internal" ;
22import __styleYak from "./input.yak.module.css!=!./input?./input.yak.module.css" ;
3- export const YakLogo = ( ) => < div { .../*YAK EXPORTED MIXIN:YakLogo
3+ export const YakLogo = ( ) => < div { .../*YAK Extracted CSS:
44.YakLogo {
55 display: flex;
66 gap: 6px;
77}
8- */ /*#__PURE__*/ css ( ) ( { } ) } >
8+ */ /*#__PURE__*/ css ( __styleYak . YakLogo ) ( { } ) } >
99 Yak
1010 </ div > ;
You can’t perform that action at this time.
0 commit comments