From adbc2039fce1bcdec62c38d1062975b2785fe4f7 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Wed, 13 Dec 2023 17:44:50 +0100 Subject: [PATCH] Move the .body-link CSS component class to a plugin --- .../solidus_admin/application.tailwind.css.erb | 6 ------ admin/config/solidus_admin/tailwind.config.js.erb | 12 +++++++++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/admin/app/assets/stylesheets/solidus_admin/application.tailwind.css.erb b/admin/app/assets/stylesheets/solidus_admin/application.tailwind.css.erb index 8b062d516a9..248516b671c 100644 --- a/admin/app/assets/stylesheets/solidus_admin/application.tailwind.css.erb +++ b/admin/app/assets/stylesheets/solidus_admin/application.tailwind.css.erb @@ -2,10 +2,4 @@ @tailwind components; @tailwind utilities; -@layer components { - .body-link { - @apply text-blue hover:underline; - } -} - <%= SolidusAdmin::Config.tailwind_stylesheets.map { File.read(_1) }.join("\n") %> diff --git a/admin/config/solidus_admin/tailwind.config.js.erb b/admin/config/solidus_admin/tailwind.config.js.erb index f6ee0134036..81333c2eee1 100644 --- a/admin/config/solidus_admin/tailwind.config.js.erb +++ b/admin/config/solidus_admin/tailwind.config.js.erb @@ -89,7 +89,7 @@ module.exports = { require('@tailwindcss/aspect-ratio'), require('@tailwindcss/typography'), require('@tailwindcss/container-queries'), - plugin(({ addVariant, addBase }) => { + plugin(({ addVariant, addBase, addComponents, theme }) => { // Support the "hidden" attribute addVariant('hidden', '&([hidden])') addVariant('visible', '&:not([hidden])') @@ -103,6 +103,16 @@ module.exports = { 'summary::marker': { display: 'none' }, 'summary': { listStyle: 'none' }, }) + + // Add a text style for links + addComponents({ + '.body-link': { + color: theme('colors.blue'), + '&:hover': { + textDecoration: 'underline', + }, + }, + }) }), ], }