Skip to content

Commit

Permalink
fix(Tooltip): fix background styles
Browse files Browse the repository at this point in the history
  • Loading branch information
driss-chelouati committed Feb 22, 2024
1 parent e30a65a commit dbd3a62
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions src/plugins/components/tooltip/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ export default plugin(({ addComponents, theme }) => {
borderRadius: '0.5ch',
zIndex: '1000',
[`@apply font-${config.font.family} text-xs shadow-lg`]: {},
[`@apply text-${config.font.color.light}`]: {},
[`@apply bg-${config.background.light}`]: {},
},
[`.dark [${tooltip}]::after`]: {
[`@apply text-${config.font.color.dark}`]: {},
[`@apply bg-${config.background.dark}`]: {},
[`@apply text-${config.font.color.light} dark:text-${config.font.color.light}`]:
{},
[`@apply bg-${config.background.light} dark:bg-${config.background.dark}`]:
{},
},
[`[${tooltip}]:hover::before, [${tooltip}]:hover::after, [${tooltip}]:focus-visible::before, [${tooltip}]:focus-visible::after`]:
{
Expand All @@ -86,11 +84,8 @@ export default plugin(({ addComponents, theme }) => {
bottom: 'calc(100% + 8px)',
borderBottomWidth: '0',
borderTopColor: 'currentColor',
[`@apply text-${config.background.light}`]: {},
},
[`.dark [${tooltip}]:not([${position}])::before, .dark [${tooltip}][${position}^='up']::before`]:
{
[`@apply text-${config.background.dark}`]: {},
[`@apply text-${config.background.light} dark:text-${config.background.light}`]:
{},
},
[`[${tooltip}]:not([${position}])::after, [${tooltip}][${position}^='up']::after`]:
{
Expand All @@ -107,10 +102,8 @@ export default plugin(({ addComponents, theme }) => {
top: '100%',
borderTopWidth: '0',
borderBottomColor: 'currentColor',
[`@apply text-${config.background.light}`]: {},
},
[`.dark [${tooltip}][${position}^='down']::before`]: {
[`@apply text-${config.background.dark}`]: {},
[`@apply text-${config.background.light} dark:text-${config.background.dark}`]:
{},
},
[`[${tooltip}][${position}^='down']::after`]: {
top: 'calc(100% + 5px)',
Expand All @@ -129,8 +122,8 @@ export default plugin(({ addComponents, theme }) => {
borderLeftColor: 'currentColor',
insetInlineStart: 'calc(0em - 5px)',
transform: 'translate(-0.5em, -50%)',
[`@apply text-${config.background.light}`]: {},
[`@apply text-${config.background.dark}`]: {},
[`@apply text-${config.background.light} dark:text-${config.background.dark}`]:
{},
},
[`[${tooltip}][${position}^='start']::after, [${tooltip}][${position}^='left']::after`]:
{
Expand All @@ -147,8 +140,8 @@ export default plugin(({ addComponents, theme }) => {
borderRightColor: 'currentColor',
insetInlineEnd: 'calc(0em - 5px)',
transform: 'translate(0.5em, -50%)',
[`@apply text-${config.background.light}`]: {},
[`@apply text-${config.background.dark}`]: {},
[`@apply text-${config.background.light} dark:text-${config.background.dark}`]:
{},
},
[`[${tooltip}][${position}^='end']::after, [${tooltip}][${position}^='right']::after`]:
{
Expand Down

0 comments on commit dbd3a62

Please sign in to comment.