From a746a781b4bfc78209cf8302c6d7bb3cb452e446 Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Fri, 5 Nov 2021 14:36:34 +0000 Subject: [PATCH] feat(themes): set generic css variables for colors to enable instance themes - set new colors using the css variables for theming in tailwind.config.js - replace admin and public colors with new variable enabled colors --- app/Entities/EpisodeComment.php | 2 +- app/Helpers/components_helper.php | 22 ++--- app/Helpers/page_helper.php | 8 +- app/Resources/js/audio-player.ts | 10 ++- app/Resources/js/modules/EpisodesMap.ts | 6 +- app/Resources/js/modules/Tooltip.ts | 7 +- app/Resources/js/modules/markdown-preview.ts | 16 +++- .../js/modules/markdown-write-preview.ts | 2 +- app/Resources/js/modules/permalink-edit.ts | 1 + .../js/modules/play-episode-button.ts | 17 ++-- app/Resources/js/modules/xml-editor.ts | 25 +++++- app/Resources/styles/breadcrumb.css | 5 +- app/Resources/styles/charts.css | 15 ---- app/Resources/styles/choices.css | 30 +++---- app/Resources/styles/colors.css | 80 +++++++++++++++++++ app/Resources/styles/custom.css | 43 ++++------ app/Resources/styles/formInputTabs.css | 8 +- app/Resources/styles/index.css | 2 +- app/Resources/styles/radioBtn.css | 15 ++-- app/Resources/styles/seeMore.css | 8 +- app/Resources/styles/switch.css | 8 +- app/Resources/styles/tailwind.css | 2 - app/Views/Components/Alert.php | 2 +- app/Views/Components/Button.php | 7 +- .../Components/Charts/ChartsComponent.php | 2 +- app/Views/Components/DropdownMenu.php | 6 +- app/Views/Components/Forms/Checkbox.php | 2 +- app/Views/Components/Forms/DatetimePicker.php | 4 +- app/Views/Components/Forms/Helper.php | 2 +- app/Views/Components/Forms/Input.php | 4 +- app/Views/Components/Forms/MarkdownEditor.php | 34 ++++---- app/Views/Components/Forms/MultiSelect.php | 2 +- app/Views/Components/Forms/Radio.php | 2 +- app/Views/Components/Forms/RadioButton.php | 2 +- app/Views/Components/Forms/Section.php | 4 +- app/Views/Components/Forms/Select.php | 2 +- app/Views/Components/Forms/Textarea.php | 2 +- app/Views/Components/Heading.php | 2 +- app/Views/Components/IconButton.php | 3 +- app/Views/errors/html/error_404.php | 6 +- app/Views/errors/html/production.php | 4 +- app/Views/pager/default_full.php | 12 +-- modules/Fediverse/Entities/Post.php | 2 +- package-lock.json | 30 +++---- package.json | 30 +++---- tailwind.config.js | 63 +++++++++++++++ themes/cp_admin/_layout.php | 8 +- themes/cp_admin/_partials/_nav_aside.php | 4 +- themes/cp_admin/_partials/_nav_header.php | 20 ++--- themes/cp_admin/_partials/_user_info.php | 16 ++-- themes/cp_admin/_sidebar.php | 4 +- themes/cp_admin/contributor/view.php | 12 +-- themes/cp_admin/episode/_card.php | 4 +- themes/cp_admin/episode/_sidebar.php | 10 +-- themes/cp_admin/episode/edit.php | 16 ++-- themes/cp_admin/episode/list.php | 8 +- themes/cp_admin/episode/persons.php | 4 +- themes/cp_admin/episode/publish.php | 20 ++--- themes/cp_admin/episode/publish_edit.php | 20 ++--- themes/cp_admin/page/list.php | 2 +- themes/cp_admin/person/_card.php | 4 +- themes/cp_admin/person/view.php | 21 +++-- themes/cp_admin/podcast/_card.php | 4 +- themes/cp_admin/podcast/_sidebar.php | 10 +-- themes/cp_admin/podcast/create.php | 4 +- themes/cp_admin/podcast/edit.php | 12 +-- themes/cp_admin/podcast/import.php | 2 +- themes/cp_admin/podcast/latest_episodes.php | 2 +- themes/cp_admin/podcast/persons.php | 4 +- themes/cp_admin/podcast/platforms.php | 24 +++--- themes/cp_admin/settings/general.php | 2 +- themes/cp_admin/user/list.php | 4 +- themes/cp_app/_admin_navbar.php | 18 ++--- themes/cp_app/_layout.php | 16 ++-- themes/cp_app/_persons_modal.php | 10 +-- themes/cp_app/credits.php | 12 +-- themes/cp_app/embed.php | 2 +- themes/cp_app/episode/_layout.php | 36 ++++----- themes/cp_app/episode/_partials/card.php | 8 +- themes/cp_app/episode/_partials/comment.php | 4 +- .../episode/_partials/comment_actions.php | 4 +- .../_partials/comment_actions_from_post.php | 4 +- .../cp_app/episode/_partials/comment_card.php | 10 +-- .../episode/_partials/comment_reply.php | 6 +- .../_partials/comment_reply_actions.php | 6 +- .../_partials/comment_with_replies.php | 12 +-- .../cp_app/episode/_partials/navigation.php | 6 +- .../cp_app/episode/_partials/preview_card.php | 8 +- themes/cp_app/episode/activity.php | 4 +- themes/cp_app/episode/comment.php | 2 +- themes/cp_app/home.php | 14 ++-- themes/cp_app/map.php | 14 ++-- themes/cp_app/page.php | 12 +-- themes/cp_app/podcast/_layout.php | 16 ++-- .../podcast/_partials/funding_links_modal.php | 8 +- .../cp_app/podcast/_partials/navigation.php | 6 +- themes/cp_app/podcast/_partials/sidebar.php | 28 +++---- themes/cp_app/podcast/about.php | 8 +- themes/cp_app/podcast/activity.php | 4 +- themes/cp_app/podcast/episodes.php | 8 +- themes/cp_app/podcast/follow.php | 18 ++--- themes/cp_app/post/_partials/actions.php | 26 +++--- themes/cp_app/post/_partials/card.php | 8 +- .../post/_partials/post_with_replies.php | 14 ++-- themes/cp_app/post/_partials/preview_card.php | 18 ++--- themes/cp_app/post/_partials/reblog.php | 10 +-- themes/cp_app/post/_partials/reply.php | 8 +- .../cp_app/post/_partials/reply_actions.php | 26 +++--- themes/cp_app/post/post.php | 2 +- themes/cp_app/post/remote_action.php | 6 +- themes/cp_auth/_layout.php | 10 +-- themes/cp_auth/forgot.php | 2 +- themes/cp_install/_layout.php | 8 +- themes/cp_install/cache_config.php | 4 +- themes/cp_install/create_superadmin.php | 2 +- themes/cp_install/database_config.php | 4 +- themes/cp_install/instance_config.php | 2 +- themes/cp_install/manual_config.php | 2 +- 118 files changed, 701 insertions(+), 557 deletions(-) delete mode 100644 app/Resources/styles/charts.css create mode 100644 app/Resources/styles/colors.css diff --git a/app/Entities/EpisodeComment.php b/app/Entities/EpisodeComment.php index d30e3c5a..4d4774e4 100644 --- a/app/Entities/EpisodeComment.php +++ b/app/Entities/EpisodeComment.php @@ -119,7 +119,7 @@ class EpisodeComment extends UuidEntity public function getHasReplies(): bool { - return $this->getReplies() !== null; + return $this->getReplies() !== []; } public function getReplyToComment(): ?self diff --git a/app/Helpers/components_helper.php b/app/Helpers/components_helper.php index fd05c267..15ad1c08 100644 --- a/app/Helpers/components_helper.php +++ b/app/Helpers/components_helper.php @@ -24,9 +24,9 @@ if (! function_exists('hint_tooltip')) { function hint_tooltip(string $hintText = '', string $class = ''): string { $tooltip = - '', 'thead_open' => - '', + '', 'heading_cell_start' => '', 'cell_start' => '', 'cell_alt_start' => '', - 'row_start' => '', - 'row_alt_start' => '', + 'row_start' => '', + 'row_alt_start' => '', ]; $table->setTemplate($template); @@ -88,7 +88,7 @@ if (! function_exists('data_table')) { return lang('Common.no_data'); } - return '
' . + return '
' . $table->generate() . '
'; } @@ -105,7 +105,7 @@ if (! function_exists('publication_pill')) { function publication_pill(?Time $publicationDate, string $publicationStatus, string $customClass = ''): string { $class = match ($publicationStatus) { - 'published' => 'text-pine-600 border-pine-600 bg-pine-50', + 'published' => 'text-pine-500 border-pine-500 bg-pine-50', 'scheduled' => 'text-red-600 border-red-600 bg-red-50', 'not_published' => 'text-gray-600 border-gray-600 bg-gray-50', default => 'text-gray-600 border-gray-600 bg-gray-50', @@ -208,7 +208,7 @@ if (! function_exists('episode_numbering')) { $class . '" title="' . lang($transKey, $args) . - '">' . + '" data-tooltip="bottom">' . lang($transKey . '_abbr', $args) . ''; } @@ -238,7 +238,7 @@ if (! function_exists('location_link')) { icon('map-pin', 'mr-2') . $location->name, [ 'class' => - 'inline-flex items-baseline hover:underline focus:ring-castopod' . + 'inline-flex items-baseline hover:underline focus:ring-accent' . ($class === '' ? '' : " {$class}"), 'target' => '_blank', 'rel' => 'noreferrer noopener', @@ -264,8 +264,8 @@ if (! function_exists('audio_player')) { theme="light" language="{$language}" icons="castopod-icons" - class="{$class}" - style="--vm-player-box-shadow:0; --vm-player-theme: #009486; --vm-control-spacing: 4px;" + class="{$class} relative z-0" + style="--vm-player-box-shadow:0; --vm-player-theme: hsl(var(--color-accent-base)); --vm-control-focus-color: hsl(var(--color-accent-contrast)); --vm-control-spacing: 4px; --vm-menu-item-focus-bg: hsl(var(--color-background-highlight));" > diff --git a/app/Helpers/page_helper.php b/app/Helpers/page_helper.php index 13ecee41..beb1eb27 100644 --- a/app/Helpers/page_helper.php +++ b/app/Helpers/page_helper.php @@ -20,17 +20,17 @@ if (! function_exists('render_page_links')) { { $pages = (new PageModel())->findAll(); $links = anchor(route_to('home'), lang('Common.home'), [ - 'class' => 'px-2 py-1 underline hover:no-underline focus:ring-castopod', + 'class' => 'px-2 py-1 underline hover:no-underline focus:ring-accent', ]); $links .= anchor(route_to('credits'), lang('Person.credits'), [ - 'class' => 'px-2 py-1 underline hover:no-underline focus:ring-castopod', + 'class' => 'px-2 py-1 underline hover:no-underline focus:ring-accent', ]); $links .= anchor(route_to('map'), lang('Page.map'), [ - 'class' => 'px-2 py-1 underline hover:no-underline focus:ring-castopod', + 'class' => 'px-2 py-1 underline hover:no-underline focus:ring-accent', ]); foreach ($pages as $page) { $links .= anchor($page->link, $page->title, [ - 'class' => 'px-2 py-1 underline hover:no-underline focus:ring-castopod', + 'class' => 'px-2 py-1 underline hover:no-underline focus:ring-accent', ]); } diff --git a/app/Resources/js/audio-player.ts b/app/Resources/js/audio-player.ts index 41a17ab8..577853e4 100644 --- a/app/Resources/js/audio-player.ts +++ b/app/Resources/js/audio-player.ts @@ -39,14 +39,18 @@ import "./modules/play-episode-button"; const player = html`