Skip to content

Commit

Permalink
Fixing util imports
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook committed Oct 10, 2024
1 parent ec2057e commit ba769ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
14 changes: 13 additions & 1 deletion src/css/tailwind.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { isTruthy, kebabize } from '../utils'

import { Atoms } from './atoms'
import { isTruthy, kebabize } from './utils'

type TextVariant = 'ellipsis' | 'capitalize' | 'lowercase' | 'uppercase'

Expand Down Expand Up @@ -195,6 +196,17 @@ const tailwindMap: {
return null
},

textDecoration: value => {
switch (value) {
case 'none':
return 'no-underline'
case 'underline':
return 'underline'
}

return null
},

textOverflow: value => {
switch (value) {
case 'ellipsis':
Expand Down
3 changes: 0 additions & 3 deletions src/css/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ export const responsiveStyle = (rules: {

export const selectorize = (classNames: string) =>
'.' + classNames.split(' ').join('.')

export const isTruthy = <T>(value: T | undefined | null): value is T =>
Boolean(value)
2 changes: 1 addition & 1 deletion transforms/tailwind-transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TailwindMapName,
TAILWIND_MAP_NAMES,
} from '../src/css/tailwind'
import { isTruthy } from '../src/css/utils'
import { isTruthy } from '../src/utils'

const COMPONENTS = ['Box', 'Text']

Expand Down

0 comments on commit ba769ad

Please sign in to comment.