Skip to content
shaan1974 edited this page Sep 8, 2020 · 1 revision

base64css

Powered by Php the purpose of this is to take a css file and get all externals ressoures like images, fonts, css (@import) and combine into a single file.

Images, fonts are transform into base64 data-uri. Css from @import are incorporated into the main css.

Features

  • Support : "oet", "svg", "ttf" ,"woff" ,"woff2" ,"gif" ,"ico" ,"jpe" ,"jpeg" ,"jpg" ,"png" files.
  • Options :
  • "css_minify" : [true/false] - Minify css or not.
  • "rbg_to_hex" : [true/false]- Transform Rgb/Rgba colors into Hex.
  • "named_colors_to_hex" : [true/false] - Transform named color into Hex.
  • Outpout could be save.

Examples.

require_once "../css64/rhea_css64_class.php"; 

$CSS64 = new Rhea_Css64();

$CSS64->css_file = __DIR__. '/../data_css/css.css';
$CSS64->css_minify = true;
$CSS64->rbg_to_hex = true;

$r = $CSS64->transform();
require_once "../css64/rhea_css64_class.php"; 

$CSS64 = new Rhea_Css64();

$CSS64->css_file = __DIR__. '/../data_css/css.css';
$CSS64->css_minify = true;
$CSS64->transform();

$CSS64->save( __DIR__. '/../data_css_b64/css.css');
Clone this wiki locally