Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Mar 6, 2024
1 parent 3562c95 commit 68a07a4
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 87 deletions.
238 changes: 157 additions & 81 deletions config/playground-blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
'themes' => [
'default' => [
'bsTheme' => '',
// 'editor' => '',
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_DEFAULT_ENABLE', true),
'label' => 'Default Theme',
'key' => 'default',
Expand All @@ -25,24 +24,6 @@
'asset' => 'comment',
'comment' => 'head: using the default theme',
],
// 'bootstrap-root' => [
// 'rel' => 'stylesheet',
// 'asset' => 'stylesheet',
// 'href' => '/vendor/bootstrap-root-0001.css',
// 'version' => '5.3.3',
// 'always' => true,
// ],
'anta' => [
'asset' => 'font',
'href' => 'https://fonts.googleapis.com/css2?family=Anta&display=swap',
'rel' => 'stylesheet',
'always' => true,
],
'font-headers' => [
'asset' => 'style',
'style' => 'h1, h2, h3, h4, h5, h6 {font-family: Anta, sans-serif;}',
'always' => true,
],
],
'body' => [
'comment' => [
Expand All @@ -53,11 +34,10 @@
],
'blue' => [
'bsTheme' => 'blue',
// 'editor' => '',
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_DEFAULT_ENABLE', true),
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_BLUE_ENABLE', true),
'label' => 'Blue Theme',
'key' => 'blue',
'icon' => 'fa-solid fa-circle',
'icon' => 'fa-solid fa-fish-fins',
'provider' => 'bootstrap',
'session' => true,
'head' => [
Expand All @@ -72,15 +52,23 @@
'version' => '5.3.3',
'always' => true,
],
'anta' => [
'font-lobster' => [
'asset' => 'font',
'docs' => 'https://fonts.google.com/specimen/Lobster',
'href' => 'https://fonts.googleapis.com/css2?family=Lobster&display=swap',
'rel' => 'stylesheet',
'always' => true,
],
'font-headers' => [
'asset' => 'style',
'style' => 'h1, h2, h3, h4, h5, h6 {font-family: Lobster, sans-serif;}',
'style' => 'h1, h2, h3, h4, h5, h6, .card-title, label, fieldset, nav {font-family: Lobster, sans-serif;}',
'always' => true,
],
'ckeditor-bootstrap' => [
'rel' => 'stylesheet',
'asset' => 'stylesheet',
'href' => '/vendor/ckeditor-bootstrap.css',
'version' => '41.1.0',
'always' => true,
],
],
Expand All @@ -91,110 +79,198 @@
],
],
],
'dark' => [
'bsTheme' => 'dark',
// 'editor' => '/vendor/ckeditor-dark.css',
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_DARK_ENABLE', true),
'label' => 'Dark Theme',
'key' => 'dark',
'icon' => 'fa-solid fa-moon',
'pepper' => [
'bsTheme' => 'pepper',
// 'editor' => '',
'enable' => true,
'label' => 'Pepper Theme',
'key' => 'pepper',
'icon' => 'fa-solid fa-pepper-hot',
'provider' => 'bootstrap',
'session' => true,
'head' => [
'ckeditor-dark' => [
'comment' => [
'asset' => 'comment',
'comment' => 'head: using the pepper theme',
],
'bootstrap-root' => [
'rel' => 'stylesheet',
'asset' => 'stylesheet',
'href' => '/vendor/ckeditor-dark.css',
'version' => '41.1.0',
'href' => '/vendor/bootstrap-root-pepper.css',
'version' => '5.3.3',
'always' => true,
],
],
],
'light' => [
'bsTheme' => 'light',
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_LIGHT_ENABLE', true),
'label' => 'Light Theme',
'key' => 'light',
'icon' => 'fa-solid fa-sun',
'provider' => 'bootstrap',
'session' => true,
'head' => [
'ckeditor-light' => [
'font-anta' => [
'asset' => 'font',
'docs' => 'https://fonts.google.com/specimen/Anta',
'href' => 'https://fonts.googleapis.com/css2?family=Anta&display=swap',
'rel' => 'stylesheet',
'asset' => 'stylesheet',
'href' => '/vendor/ckeditor-light.css',
'version' => '41.1.0',
'always' => true,
],
],
],
'bootstrap-dark' => [
'bsTheme' => 'dark',
'enable' => false,
'label' => 'CKEditor Unified Bootstrap Theme under Dark',
'key' => 'bootstrap-dark',
'icon' => 'fa-brands fa-bootstrap',
'provider' => 'bootstrap',
'session' => true,
'head' => [
'ckeditor-light' => [
'font-lobster' => [
'asset' => 'font',
'docs' => 'https://fonts.google.com/specimen/Lobster',
'href' => 'https://fonts.googleapis.com/css2?family=Lobster&display=swap',
'rel' => 'stylesheet',
'always' => true,
],
'font-quicksand' => [
'asset' => 'font',
'docs' => 'https://fonts.google.com/specimen/Quicksand',
'href' => 'https://fonts.googleapis.com/css2?family=Quicksand:[email protected]&display=swap',
'rel' => 'stylesheet',
'always' => true,
],
'font-rokkitt' => [
'asset' => 'font',
'docs' => 'https://fonts.google.com/specimen/Rokkitt',
'href' => 'https://fonts.googleapis.com/css2?family=Rokkitt:ital,wght@0,100..900;1,100..900&display=swap',
'rel' => 'stylesheet',
'always' => true,
],
'font-h1' => [
'asset' => 'style',
'style' => 'h1 {font-family: Lobster, sans-serif;}',
'always' => true,
],
'font-headers' => [
'asset' => 'style',
'style' => 'h2, h3, h4, h5, h6 {font-family: Quicksand, sans-serif;}',
'always' => true,
],
'font-title' => [
'asset' => 'style',
'style' => '.card-header {font-family: Anta, sans-serif;}',
'always' => true,
],
'font-display' => [
'asset' => 'style',
'style' => '.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {font-family: Lobster, sans-serif;}',
'always' => true,
],
'font-lead' => [
'asset' => 'style',
'style' => '.lead, label, fieldset {font-family: Rokkitt, serif;}',
'always' => true,
],
'ckeditor-bootstrap' => [
'rel' => 'stylesheet',
'asset' => 'stylesheet',
'href' => '/vendor/ckeditor-bootstrap.css',
'version' => '41.1.0',
'always' => true,
],
],
'body' => [
'comment' => [
'asset' => 'comment',
'comment' => 'body: using the pepper theme',
],
],
],
'bootstrap-light' => [
'bsTheme' => 'light',
'enable' => false,
'label' => 'CKEditor Unified Bootstrap Theme under Light',
'key' => 'bootstrap-light',
'icon' => 'fa-brands fa-bootstrap',
'purple' => [
'bsTheme' => 'purple',
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_PURPLE_ENABLE', true),
'label' => 'Purple Theme',
'key' => 'purple',
'icon' => 'fa-solid fa-microchip',
'provider' => 'bootstrap',
'session' => true,
'head' => [
'ckeditor-light' => [
'comment' => [
'asset' => 'comment',
'comment' => 'head: using the purple theme',
],
'bootstrap-root' => [
'rel' => 'stylesheet',
'asset' => 'stylesheet',
'href' => '/vendor/bootstrap-root-purple.css',
'version' => '5.3.3',
'always' => true,
],
'font-anta' => [
'asset' => 'font',
'docs' => 'https://fonts.google.com/specimen/Anta',
'href' => 'https://fonts.googleapis.com/css2?family=Anta&display=swap',
'rel' => 'stylesheet',
'always' => true,
],
'font-bruno-ace-sc' => [
'asset' => 'font',
'docs' => 'https://fonts.google.com/specimen/Bruno+Ace+SC',
'href' => 'https://fonts.googleapis.com/css2?family=Bruno+Ace+SC&display=swap',
'rel' => 'stylesheet',
'always' => true,
],
'font-kode-mono' => [
'asset' => 'font',
'docs' => 'https://fonts.google.com/specimen/Kode+Mono',
'href' => 'https://fonts.googleapis.com/css2?family=Kode+Mono:[email protected]&display=swap',
'rel' => 'stylesheet',
'always' => true,
],
'font-headers' => [
'asset' => 'style',
'style' => 'h1, h2, h3, h4, h5, h6, label, nav {font-family: Anta, sans-serif;}',
'always' => true,
],
'font-title' => [
'asset' => 'style',
'style' => '.card-header, legend {font-family: "Bruno Ace SC", sans-serif;}',
'always' => true,
],
'font-monospace' => [
'asset' => 'style',
'style' => 'code, pre {font-family: "Kode Mono", monospace;}',
'always' => true,
],
'ckeditor-bootstrap' => [
'rel' => 'stylesheet',
'asset' => 'stylesheet',
'href' => '/vendor/ckeditor-bootstrap.css',
'version' => '41.1.0',
'always' => true,
],
],
'body' => [
'comment' => [
'asset' => 'comment',
'comment' => 'body: using the purple theme',
],
],
],
'lark-dark' => [
'dark' => [
'bsTheme' => 'dark',
'enable' => false,
'label' => 'CKEditor Lark Theme under Dark',
'key' => 'lark-dark',
'icon' => 'fa-solid fa-dove fa-moon',
// 'editor' => '/vendor/ckeditor-dark.css',
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_DARK_ENABLE', true),
'label' => 'Dark Theme',
'key' => 'dark',
'icon' => 'fa-solid fa-moon',
'provider' => 'bootstrap',
'session' => true,
'head' => [
'ckeditor-light' => [
'ckeditor-dark' => [
'rel' => 'stylesheet',
'asset' => 'stylesheet',
'href' => '/vendor/ckeditor-lark.css',
'href' => '/vendor/ckeditor-dark.css',
'version' => '41.1.0',
'always' => true,
],
],
],
'lark-light' => [
'light' => [
'bsTheme' => 'light',
'enable' => false,
'label' => 'CKEditor Lark Theme under Light',
'key' => 'lark-light',
'icon' => 'fa-solid fa-dove fa-sun',
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_LIGHT_ENABLE', true),
'label' => 'Light Theme',
'key' => 'light',
'icon' => 'fa-solid fa-sun',
'provider' => 'bootstrap',
'session' => true,
'head' => [
'ckeditor-light' => [
'rel' => 'stylesheet',
'asset' => 'stylesheet',
'href' => '/vendor/ckeditor-lark.css',
'href' => '/vendor/ckeditor-light.css',
'version' => '41.1.0',
'always' => true,
],
Expand Down
15 changes: 9 additions & 6 deletions resources/views/layouts/bootstrap/nav.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,18 @@
Themes
</p>
</li>
@foreach (Playground\Blade\Facades\Ui::themes() as $themeKey => $theme)
@continue(!$theme->enabled() || !$theme->label())
@php
$selectedTheme = Playground\Blade\Facades\Ui::theme()->bsTheme();
@endphp
@foreach (Playground\Blade\Facades\Ui::themes() as $themeKey => $_theme)
@continue(!$_theme->enabled() || !$_theme->label())
<li>
<a class="dropdown-item"
<a class="dropdown-item{{ (empty($selectedTheme) && 'default' === $themeKey || $selectedTheme === $themeKey) ? ' active' : ''}}"
href="{{ route('theme', ['appTheme' => $themeKey ?? '', '_return_url' => request()->url()]) }}">
@if ($theme->icon())
<i class="{{ $theme->icon() }}"></i>
@if ($_theme->icon())
<i class="{{ $_theme->icon() }}"></i>
@endif
{{ $theme->label() }}
{{ $_theme->label() }}
</a>
</li>
@endforeach
Expand Down

0 comments on commit 68a07a4

Please sign in to comment.