Skip to content

Commit

Permalink
actually..... do it in tailwind with group. yowza
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Oct 29, 2024
1 parent a3d736b commit 4ecef06
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
10 changes: 8 additions & 2 deletions app/components/HL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
*/
import { classed } from '~/util/classed'

// ox-highlight needed for CSS ensuring the HL color matches the container
export const HL = classed.span`ox-highlight text-sans-md text-default`
// note parent with secondary text color must have 'group' on it for
// this to work. see Toast for an example
export const HL = classed.span`
text-sans-md text-default
group-[.text-accent-secondary]:text-accent
group-[.text-error-secondary]:text-error
group-[.text-info-secondary]:text-info
`
5 changes: 4 additions & 1 deletion app/ui/lib/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ export const Toast = ({
{(title || variant !== 'success') && (
<div className="text-sans-semi-md">{title || defaultTitle[variant]}</div>
)}
<div className={cn('text-sans-md', secondaryTextColor[variant])}>{content}</div>
{/* 'group' is necessary for HL color trick to work. see HL.tsx */}
<div className={cn('group text-sans-md', secondaryTextColor[variant])}>
{content}
</div>

{cta && (
<Link
Expand Down
17 changes: 0 additions & 17 deletions app/ui/styles/components/highlight.css

This file was deleted.

1 change: 0 additions & 1 deletion app/ui/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
@import './components/loading-bar.css';
@import './components/Tabs.css';
@import './components/form.css';
@import './components/highlight.css';
@import './components/login-page.css';
@import './components/mini-table.css';
@import './components/properties-table.css';
Expand Down

0 comments on commit 4ecef06

Please sign in to comment.