File tree Expand file tree Collapse file tree 2 files changed +30
-6
lines changed
Expand file tree Collapse file tree 2 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @devup-ui/wasm " : patch
3+ ---
4+
5+ Add css banner
Original file line number Diff line number Diff line change @@ -543,13 +543,32 @@ impl StyleSheet {
543543 current_css
544544 }
545545
546+ fn create_header ( & self ) -> String {
547+ format ! (
548+ "/*! devup-ui v{version} | Apache License 2.0 | https://devup-ui.com */" ,
549+ // get version from package.json
550+ version = include_str!( "../../../bindings/devup-ui-wasm/package.json" )
551+ . lines( )
552+ . find( |line| line. contains( "\" version\" " ) )
553+ . unwrap( )
554+ . split( ":" )
555+ . nth( 1 )
556+ . unwrap( )
557+ . trim( )
558+ . replace( "\" " , "" ) ,
559+ )
560+ }
561+
546562 pub fn create_css ( & self , filename : Option < & str > , import_main_css : bool ) -> String {
547- let mut css = self
548- . imports
549- . values ( )
550- . flatten ( )
551- . map ( |import| format ! ( "@import \" {import}\" ;" ) )
552- . collect :: < String > ( ) ;
563+ let mut css = format ! (
564+ "{}{}" ,
565+ self . create_header( ) ,
566+ self . imports
567+ . values( )
568+ . flatten( )
569+ . map( |import| format!( "@import \" {import}\" ;" ) )
570+ . collect:: <String >( )
571+ ) ;
553572
554573 let write_global = filename. is_none ( ) ;
555574
You can’t perform that action at this time.
0 commit comments