File tree Expand file tree Collapse file tree 6 files changed +20
-6
lines changed
Expand file tree Collapse file tree 6 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 11.test-css-inline-client {
2- padding : 8px ;
3- margin : 4px ;
2+ color : rgb (255 , 50 , 0 );
43}
Original file line number Diff line number Diff line change 11.test-css-raw-client {
2- font-weight : bold ;
2+ color : rgb ( 255 , 0 , 0 ) ;
33}
Original file line number Diff line number Diff line change 11.test-css-url-client {
2- border : 2 px solid rgb (0 , 0 , 255 );
2+ color : rgb (255 , 100 , 0 );
33}
Original file line number Diff line number Diff line change 33import cssUrl from './client-url.css?url'
44import cssInline from './client-inline.css?inline'
55import cssRaw from './client-raw.css?raw'
6+ import React from 'react'
67
78export function TestCssQueriesClient ( ) {
9+ const [ enabled , setEnabled ] = React . useState ( false )
810 return (
911 < div >
12+ < button onClick = { ( ) => setEnabled ( ! enabled ) } >
13+ test-css-queries-client
14+ </ button >
15+ { enabled && (
16+ < >
17+ < link rel = "stylesheet" href = { cssUrl } />
18+ < style > { cssInline } </ style >
19+ < style > { cssRaw } </ style >
20+ </ >
21+ ) }
1022 < div className = "test-css-url-client" > test-css-url-client: { cssUrl } </ div >
1123 < div className = "test-css-inline-client" >
1224 test-css-inline-client:{ ' ' }
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export default async function handler(request: Request): Promise<Response> {
2626 `default-src 'self';` ,
2727 // `unsafe-eval` is required during dev since React uses eval for findSourceMapURL feature
2828 `script-src 'self' 'nonce-${ nonce } ' ${ import . meta. env . DEV ? `'unsafe-eval'` : `` } ;` ,
29- `style-src 'self' 'nonce- ${ nonce } ';` ,
29+ `style-src 'self' 'unsafe-inline ';` ,
3030 // allow blob: worker for Vite server ping shared worker
3131 import . meta. hot && `worker-src 'self' blob:;` ,
3232 ]
Original file line number Diff line number Diff line change @@ -1684,7 +1684,10 @@ export function vitePluginRscCss(
16841684 }
16851685 for ( const next of mod ?. importedModules ?? [ ] ) {
16861686 if ( next . id ) {
1687- if ( isCSSRequest ( next . id ) && ! hasSpecialCssQuery ( next . id ) ) {
1687+ if ( isCSSRequest ( next . id ) ) {
1688+ if ( hasSpecialCssQuery ( next . id ) ) {
1689+ continue
1690+ }
16881691 cssIds . add ( next . id )
16891692 } else {
16901693 recurse ( next . id )
You can’t perform that action at this time.
0 commit comments