postcss inline
1.0.0
이미지와 글꼴을 데이터 URI로 CSS에 넣는 Postcss 플러그인. (Postcss 이미지 인라인 기반)
Postcss-inline의 특징은 PostCS-ORL로 병합되었습니다
@font-face {
font-family : 'MyWebFont' ;
src : url ( 'webfont.woff' ) format ( 'woff' );
}
. foo {
background-image : url (one_pixel_transparent.gif);
}
. bar {
background : url (one_pixel_transparent.gif);
} @font-face {
font-family : 'MyWebFont' ;
src : url ( 'data:application/x-font-woff;base64,AACH5BAEAAAAALA...==' ) format ( 'woff' );
}
. foo {
background-image : url (data:image/gif;base64 , R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);
}
. bar {
background : url (data:image/gif;base64 , R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);
} postcss ( [ require ( 'postcss-inline' ) ] ) // Inline only woff files:
postcss ( [ require ( 'postcss-inline' ) ( { filter : / .woff$ / } ) ] ) // Specify the base path for the assets
postcss ( [ require ( 'postcss-inline' ) ( { basePath : '/some/path' } ) ] ) // Delete assets after inline (use with care!)
postcss ( [ require ( 'postcss-inline' ) ( { deleteAsset : true } ) ] )환경에 대한 예는 PostCSS 문서를 참조하십시오.