From 988b40e335ac456f748654a8485c93b719bbc9e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sun, 4 Feb 2024 11:13:22 +0100 Subject: [PATCH] test inlining --- lib/inliner.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/inliner.php b/lib/inliner.php index 52cc485..dc32d7c 100644 --- a/lib/inliner.php +++ b/lib/inliner.php @@ -48,8 +48,14 @@ function minifyCss($css) { // Remove whitespace $css = preg_replace('/\s+/', ' ', $css); + // Remove unnecessary semicolons + $css = str_replace(';}', '}', $css); + // Remove spaces around colons - //$css = str_replace(' ', '', $css); + $css = str_replace(': ', ':', $css); + + // Remove spaces around commas + $css = str_replace(', ', ',', $css); return trim($css); }