Skip to content

Commit

Permalink
Move the .body-link CSS component class to a plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Dec 13, 2023
1 parent 7b0effe commit adbc203
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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") %>
12 changes: 11 additions & 1 deletion admin/config/solidus_admin/tailwind.config.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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])')
Expand All @@ -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',
},
},
})
}),
],
}

0 comments on commit adbc203

Please sign in to comment.