use lessc for theming TMS as is done on the tenant host

This commit is contained in:
Michael Becker 2024-11-01 23:30:30 -04:00
parent b89707a192
commit 0dd651b6a1
9 changed files with 87 additions and 5 deletions

View File

@ -1,12 +1,25 @@
@ThemeColor: #00acac;
@ThemeColorSuccess: #00acac;
@ThemeColorDanger: #ff5b57;
:root :root
{ {
--uwt-color-default: #e9ecef; --uwt-color-default: #e9ecef;
--uwt-color-primary: #348fe2; --uwt-color-primary: #348fe2;
--uwt-color-secondary: #6c757d; --uwt-color-secondary: #6c757d;
--uwt-color-success: #00acac;
--uwt-color-success-light: tint(@ThemeColorSuccess, 35%);
--uwt-color-success-dark: shade(@ThemeColorSuccess, 35%);
--uwt-color-success: @ThemeColorSuccess;
--uwt-color-info: #49b6d6; --uwt-color-info: #49b6d6;
--uwt-color-warning: #f59c1a; --uwt-color-warning: #f59c1a;
--uwt-color-danger: #ff5b57;
--uwt-color-danger-light: tint(@ThemeColorDanger, 35%);
--uwt-color-danger-dark: shade(@ThemeColorDanger, 35%);
--uwt-color-danger: @ThemeColorDanger;
--uwt-color-light: #f2f3f4; --uwt-color-light: #f2f3f4;
--uwt-color-dark: #2d353c; --uwt-color-dark: #2d353c;
--uwt-color-inverse: #2d353c; --uwt-color-inverse: #2d353c;
@ -37,7 +50,7 @@
--uwt-color-gray-800: #2d353c; --uwt-color-gray-800: #2d353c;
--uwt-color-gray-900: #20252a; --uwt-color-gray-900: #20252a;
--uwt-color-accent: #00acac; --uwt-color-accent: @ThemeColor;
--uwt-control-text: var(--uwt-color-gray-900); --uwt-control-text: var(--uwt-color-gray-900);
--uwt-dropdown-menu-highlight-background: #eff1f3; --uwt-dropdown-menu-highlight-background: #eff1f3;

View File

@ -183,3 +183,8 @@ div.uwt-listview > .uwt-content
} }
} }
} }
tr.uwt-color-danger > td
{
background-color: var(--uwt-color-danger-light);
}

View File

@ -0,0 +1,21 @@
RewriteEngine On
# Do not remove this line, otherwise mod_rewrite rules will stop working
# RewriteBase /
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^setup$ setup.php [PT,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^Themes\/(.*)\/Theme\.css$ lessc.php?filename=themes/$1/uwt [PT,L,QSA]
RewriteRule ^themes\/(.*)\/theme\.css$ lessc.php?filename=themes/$1/uwt [PT,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?virtualpath=$1 [PT,L,QSA]
#RewriteRule ^StyleSheets\/(.*)\.css$ lessc.php?filename=$1 [PT,L,QSA]

View File

@ -2,6 +2,10 @@
class System class System
{ {
public static $Configuration; public static $Configuration;
public static function ExpandRelativePath($path)
{
return str_replace("~/", "/", $path);
}
} }
System::$Configuration = array(); System::$Configuration = array();

View File

@ -20,7 +20,7 @@
<html> <html>
<head> <head>
<title>Tenant Management System</title> <title>Tenant Management System</title>
<link rel="stylesheet" type="text/css" href="style/avondale/avondale.min.css" /> <link rel="stylesheet" type="text/css" href="<?php echo(System::ExpandRelativePath("~/themes/avondale/theme.css")); ?>" />
<style type="text/css"> <style type="text/css">
a.uwt-external-link::after a.uwt-external-link::after
{ {

View File

@ -0,0 +1,36 @@
<?php
require_once ("lib/phast/Compilers/StyleSheet/LESS/Internal/LessStyleSheetCompiler.inc.php");
require_once ("lib/phast/Compilers/StyleSheet/LESS/Internal/Formatters/CompressedFormatter.inc.php");
use Phast\Compilers\StyleSheet\Internal\LessStyleSheetCompiler;
use Phast\Compilers\StyleSheet\Internal\Formatters\CompressedFormatter;
header("Content-Type: text/css");
$filename = $_GET["filename"];
if ((isset($_GET["compile"]) && $_GET["compile"] == "false") || file_exists($filename . ".css"))
{
readfile($filename . ".css");
}
else
{
try
{
#echo ("/* " . $filename . ".less" . " */");
$less = new LessStyleSheetCompiler();
$less->formatter = new CompressedFormatter();
$v = $less->compileFile($filename . ".less");
echo("/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n");
echo("/* for human-readable source of this file, replace .css with .less in the file name */\n");
echo($v);
}
catch (Exception $e)
{
echo "/* " . $e->getMessage() . " */\n";
}
}
?>

View File

@ -0,0 +1 @@
/home/beckermj/Documents/Projects/mochapowered/mocha-suv/mocha-php/mocha-php/src/mocha-php/themes/avondale

View File

@ -0,0 +1 @@
/home/beckermj/Documents/Projects/mochapowered/mocha-suv/mocha-php/mocha-php/src/mocha-php/themes/common

View File

@ -0,0 +1 @@
/home/beckermj/Documents/Projects/mochapowered/mocha-suv/mocha-php/mocha-php/src/mocha-php/themes/mocha