Skip to content

Commit 4ecef06

Browse files
committed
actually..... do it in tailwind with group. yowza
1 parent a3d736b commit 4ecef06

File tree

4 files changed

+12
-21
lines changed

4 files changed

+12
-21
lines changed

app/components/HL.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
*/
88
import { classed } from '~/util/classed'
99

10-
// ox-highlight needed for CSS ensuring the HL color matches the container
11-
export const HL = classed.span`ox-highlight text-sans-md text-default`
10+
// note parent with secondary text color must have 'group' on it for
11+
// this to work. see Toast for an example
12+
export const HL = classed.span`
13+
text-sans-md text-default
14+
group-[.text-accent-secondary]:text-accent
15+
group-[.text-error-secondary]:text-error
16+
group-[.text-info-secondary]:text-info
17+
`

app/ui/lib/Toast.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ export const Toast = ({
100100
{(title || variant !== 'success') && (
101101
<div className="text-sans-semi-md">{title || defaultTitle[variant]}</div>
102102
)}
103-
<div className={cn('text-sans-md', secondaryTextColor[variant])}>{content}</div>
103+
{/* 'group' is necessary for HL color trick to work. see HL.tsx */}
104+
<div className={cn('group text-sans-md', secondaryTextColor[variant])}>
105+
{content}
106+
</div>
104107

105108
{cta && (
106109
<Link

app/ui/styles/components/highlight.css

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/ui/styles/index.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
@import './components/loading-bar.css';
3131
@import './components/Tabs.css';
3232
@import './components/form.css';
33-
@import './components/highlight.css';
3433
@import './components/login-page.css';
3534
@import './components/mini-table.css';
3635
@import './components/properties-table.css';

0 commit comments

Comments
 (0)