廓形仪rn版本-技术调研
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

  1. import { tva } from '@gluestack-ui/nativewind-utils/tva';
  2. import { isWeb } from '@gluestack-ui/nativewind-utils/IsWeb';
  3. const baseStyle = isWeb
  4. ? 'font-sans tracking-sm my-0 bg-transparent border-0 box-border display-inline list-none margin-0 padding-0 position-relative text-start no-underline whitespace-pre-wrap word-wrap-break-word'
  5. : '';
  6. export const textStyle = tva({
  7. base: `text-typography-700 font-body ${baseStyle}`,
  8. variants: {
  9. isTruncated: {
  10. true: 'web:truncate',
  11. },
  12. bold: {
  13. true: 'font-bold',
  14. },
  15. underline: {
  16. true: 'underline',
  17. },
  18. strikeThrough: {
  19. true: 'line-through',
  20. },
  21. size: {
  22. '2xs': 'text-2xs',
  23. 'xs': 'text-xs',
  24. 'sm': 'text-sm',
  25. 'md': 'text-base',
  26. 'lg': 'text-lg',
  27. 'xl': 'text-xl',
  28. '2xl': 'text-2xl',
  29. '3xl': 'text-3xl',
  30. '4xl': 'text-4xl',
  31. '5xl': 'text-5xl',
  32. '6xl': 'text-6xl',
  33. },
  34. sub: {
  35. true: 'text-xs',
  36. },
  37. italic: {
  38. true: 'italic',
  39. },
  40. highlight: {
  41. true: 'bg-yellow-500',
  42. },
  43. },
  44. });