File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public function __construct(
1919 ?string $ mimeType = null ,
2020 /** SRI integrity hash */
2121 public readonly ?string $ integrity = null ,
22+ public readonly string |bool |null $ crossorigin = null ,
2223 ) {
2324 $ this ->mimeType = $ mimeType ?? Helpers::guessMimeTypeFromExtension ($ file ?? $ url );
2425 }
@@ -37,7 +38,7 @@ public function getImportElement(): Html
3738 'href ' => $ this ->url ,
3839 'as ' => 'font ' ,
3940 'type ' => $ this ->mimeType ,
40- 'crossorigin ' => true ,
41+ 'crossorigin ' => $ this -> crossorigin ?? true ,
4142 'integrity ' => $ this ->integrity ,
4243 ], fn ($ value ) => $ value !== null ));
4344 }
Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ function testFontAssetProperties(FontAsset $asset): void
143143 assertType ('string|null ' , $ asset ->file );
144144 assertType ('string|null ' , $ asset ->mimeType );
145145 assertType ('string|null ' , $ asset ->integrity );
146+ assertType ('bool|string|null ' , $ asset ->crossorigin );
146147}
147148
148149
You can’t perform that action at this time.
0 commit comments