Skip to content

Commit

Permalink
chore: more rationalization
Browse files Browse the repository at this point in the history
  • Loading branch information
e-krebs committed Oct 22, 2023
1 parent 7565a83 commit 7f798e3
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .ladle/stories.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

div[role='dialog'] {
@apply shadow-lg shadow-black/40;
@apply shadow-th;
}

.ladle-wrapper {
Expand Down
30 changes: 11 additions & 19 deletions shared.tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,19 @@ export default {
colors: {
gray: colors.zinc,
primary: {
50: `rgb(var(--primary-50, ${toRGB(colors.zinc[50])}) / <alpha-value>)`,
100: `rgb(var(--primary-100, ${toRGB(colors.zinc[100])}) / <alpha-value>)`,
200: `rgb(var(--primary-200, ${toRGB(colors.zinc[200])}) / <alpha-value>)`,
300: `rgb(var(--primary-300, ${toRGB(colors.zinc[300])}) / <alpha-value>)`,
400: `rgb(var(--primary-400, ${toRGB(colors.zinc[400])}) / <alpha-value>)`,
500: `rgb(var(--primary-500, ${toRGB(colors.zinc[500])}) / <alpha-value>)`,
600: `rgb(var(--primary-600, ${toRGB(colors.zinc[600])}) / <alpha-value>)`,
700: `rgb(var(--primary-700, ${toRGB(colors.zinc[700])}) / <alpha-value>)`,
800: `rgb(var(--primary-800, ${toRGB(colors.zinc[800])}) / <alpha-value>)`,
900: `rgb(var(--primary-900, ${toRGB(colors.zinc[900])}) / <alpha-value>)`,
950: `rgb(var(--primary-950, ${toRGB(colors.zinc[950])}) / <alpha-value>)`,
50: `rgb(var(--primary-50, ${toRGB(colors.gray[50])}) / <alpha-value>)`,
100: `rgb(var(--primary-100, ${toRGB(colors.gray[100])}) / <alpha-value>)`,
200: `rgb(var(--primary-200, ${toRGB(colors.gray[200])}) / <alpha-value>)`,
300: `rgb(var(--primary-300, ${toRGB(colors.gray[300])}) / <alpha-value>)`,
400: `rgb(var(--primary-400, ${toRGB(colors.gray[400])}) / <alpha-value>)`,
500: `rgb(var(--primary-500, ${toRGB(colors.gray[500])}) / <alpha-value>)`,
600: `rgb(var(--primary-600, ${toRGB(colors.gray[600])}) / <alpha-value>)`,
700: `rgb(var(--primary-700, ${toRGB(colors.gray[700])}) / <alpha-value>)`,
800: `rgb(var(--primary-800, ${toRGB(colors.gray[800])}) / <alpha-value>)`,
900: `rgb(var(--primary-900, ${toRGB(colors.gray[900])}) / <alpha-value>)`,
950: `rgb(var(--primary-950, ${toRGB(colors.gray[950])}) / <alpha-value>)`,
},
},
stroke: {
th: colors.white,
'th-dark': colors.zinc[900],
},
fill: {
th: colors.zinc[500],
'th-dark': colors.zinc[400],
},
spacing: {
icon: spacing[4],
input: spacing[9],
Expand Down
2 changes: 1 addition & 1 deletion src/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Button: FC<ButtonProps> = ({
variant === 'primary' &&
`font-medium
text-th-reversed border-primary ring-primary
bg-primary hover:enabled:bg-primary/95 selection:bg-gray-900 selection:dark:bg-gray-50`,
bg-primary hover:enabled:bg-primary/95 selection:bg-th-reversed`,
variant === 'destructive' &&
`font-medium
text-destructive
Expand Down
2 changes: 1 addition & 1 deletion src/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const Checkbox: FC<CheckboxProps> = ({ label, className, ...props }) => (
aria-hidden="true"
className={`
w-icon h-icon fill-none
stroke-3 stroke-th dark:stroke-th-dark
stroke-3 stroke-th
[stroke-dasharray:22px]
[stroke-dashoffset:66] group-selected:[stroke-dashoffset:44]
transition-all duration-150 motion-reduce:transition-none
Expand Down
4 changes: 2 additions & 2 deletions src/Modal/ModalComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const ModalComponent: ModalComponentProps = forwardRef<ModalRef, PropsWit
`relative flex flex-col rounded-xl p-6
bg-th
text-base text-th
fill-th dark:fill-th-dark`,
fill-th`,
closing ? 'animate-modal-shrink opacity-0' : 'animate-modal-grow',
contentClassName,
)}
Expand All @@ -134,7 +134,7 @@ export const ModalComponent: ModalComponentProps = forwardRef<ModalRef, PropsWit
{...titleProps}
id={titleId}
className={twMerge(
'm-0 grow truncate text-xl font-bold capitalize leading-th text-gray-900 dark:text-gray-50',
'm-0 grow truncate text-xl font-bold capitalize leading-th text-h1',
titleClassName,
)}
>
Expand Down
7 changes: 1 addition & 6 deletions src/Select/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ export const Item = <T extends Key>({ value, textValue, className, ...props }: I
{({ isSelected }) => (
<>
{isSelected && (
<Icon
id="check"
width={18}
height={18}
className="py-0.5 -ml-5 mr-0.5 text-green-600 dark:text-green-400"
/>
<Icon id="check" width={18} height={18} className="py-0.5 -ml-5 mr-0.5 text-valid" />
)}
{textValue}
</>
Expand Down
2 changes: 1 addition & 1 deletion src/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const Select = <T extends Key>({
`rounded-md leading-7
border border-th-light
bg-th
shadow-md dark:shadow-inner`,
shadow-th`,
popoverClassName,
)}
>
Expand Down
26 changes: 25 additions & 1 deletion src/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@apply bg-th text-th;
@apply selection:bg-primary selection:text-th-reversed;
@apply text-base min-h-screen;
@apply dark:fill-th-dark;
@apply fill-th;
@apply tap-highlight-primary;
}
}
Expand All @@ -17,6 +17,9 @@
.bg-th {
@apply bg-gray-50 dark:bg-gray-900;
}
.bg-th-reversed {
@apply bg-gray-900 dark:bg-gray-50;
}
.bg-primary {
@apply bg-primary-500 dark:bg-primary-400;
}
Expand Down Expand Up @@ -65,13 +68,19 @@
.text-th {
@apply text-gray-500 dark:text-gray-400;
}
.text-h1 {
@apply text-gray-900 dark:text-gray-50;
}
.text-primary {
@apply text-primary-500 dark:text-primary-400;
}
.text-destructive,
.text-error {
@apply text-red-600 dark:text-red-500;
}
.text-valid {
@apply text-green-600 dark:text-green-400;
}
.text-th-reversed {
@apply text-gray-50 dark:text-gray-900;
}
Expand Down Expand Up @@ -110,4 +119,19 @@
.caret-error {
@apply caret-red-600 dark:caret-red-500;
}

/* stroke-color classes */
.stroke-th {
@apply stroke-white dark:stroke-gray-900;
}

/* fill-color classes */
.fill-th {
@apply fill-gray-500 dark:fill-gray-400;
}

/* shadow class */
.shadow-th {
@apply shadow-md dark:shadow-inner;
}
}

0 comments on commit 7f798e3

Please sign in to comment.