From 711fdf12dc67ddd652e1747e3c5afab02fe52896 Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Tue, 3 Sep 2024 14:55:47 +0200 Subject: [PATCH] Generate CSS entrypoint for Custom Admin CSS We've moved the Admin CSS inside the Alchemy gem. This adds an entrypoint for custom CSS to the host app within the Alchemy 7.3 upgrader, and references that directly from the admin layout. --- app/views/layouts/alchemy/admin.html.erb | 1 + lib/alchemy/upgrader/seven_point_three.rb | 34 ++++++++++++++++--- lib/generators/alchemy/install/files/all.scss | 1 - .../alchemy/install/files/custom.css | 4 +++ .../alchemy/install/install_generator.rb | 2 ++ lib/tasks/alchemy/upgrade.rake | 8 ++++- spec/dummy/app/assets/config/manifest.js | 1 + .../stylesheets/alchemy/admin/custom.css | 4 +++ 8 files changed, 49 insertions(+), 6 deletions(-) delete mode 100644 lib/generators/alchemy/install/files/all.scss create mode 100644 lib/generators/alchemy/install/files/custom.css create mode 100644 spec/dummy/app/assets/stylesheets/alchemy/admin/custom.css diff --git a/app/views/layouts/alchemy/admin.html.erb b/app/views/layouts/alchemy/admin.html.erb index 123d43f515..a037ea0add 100644 --- a/app/views/layouts/alchemy/admin.html.erb +++ b/app/views/layouts/alchemy/admin.html.erb @@ -12,6 +12,7 @@ <%= stylesheet_link_tag('alchemy/admin', media: 'screen', 'data-turbo-track' => true) %> <%= stylesheet_link_tag('alchemy/admin/print', media: 'print', 'data-turbo-track' => true) %> + <%= stylesheet_link_tag('alchemy/admin/custom', 'data-turbo-track' => true) %> <%= yield :stylesheets %>