Skip to content

Commit

Permalink
feat: minify topbar css
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Sep 9, 2023
1 parent fc283da commit 9eca5cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,10 @@ public function addTopBar(&$html)

/** @var RockMigrations $rm */
$less = __DIR__ . "/bar/bar.less";
if ($rm = $this->wire->modules->get('RockMigrations')) {
// recompile less if changed
// check for method saveCSS to prevent errors on old installations
if (method_exists($rm, "saveCSS")) $rm->saveCSS($less);
}
$css = $this->toUrl("$less.css", true);
/** @var RockMigrations $rm */
$rm = $this->wire->modules->get('RockMigrations');
if ($rm) $rm->saveCSS($less, minify: true);
$css = $this->toUrl(__DIR__ . "/bar/bar.min.css", true);
$style = "<link rel='stylesheet' href='$css'>";
$html = str_replace("</head", "$style</head", $html);

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions bar/bar.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9eca5cf

Please sign in to comment.