mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
786 B
PHTML
30 lines
786 B
PHTML
4 months ago
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers;
|
||
|
|
||
|
use App\Models\Setting;
|
||
|
use Illuminate\Http\Request;
|
||
|
|
||
|
class ThemeController extends Controller
|
||
|
{
|
||
|
//
|
||
|
public function cssVariables()
|
||
|
{
|
||
|
$response = 'main{';
|
||
|
foreach (Setting::where('section', 'Theme')->whereNotNull('data')
|
||
|
->get(['value', 'data']) as $color) {
|
||
|
$data = json_decode($color->data);
|
||
|
if ($data->name) {
|
||
|
|
||
|
$response .= '--' . $data->name . ':' . $color->value;
|
||
|
if (isset($data->suffix)) {
|
||
|
$response .= $data->suffix;
|
||
|
}
|
||
|
$response .= ';';
|
||
|
}
|
||
|
}
|
||
|
$response .= '}';
|
||
|
return response($response)->header('Content-Type', 'text/css; charset=utf-8');
|
||
|
}
|
||
|
}
|