Skip to content

Commit

Permalink
Merge pull request #57 from kaishens-cn/text/select
Browse files Browse the repository at this point in the history
  • Loading branch information
cherishs001 authored May 10, 2024
2 parents a451a2e + 1b0569a commit 3dec117
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/typography/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Property } from 'csstype';
import React, { FC } from 'react';

import { ColorConfig } from '../../';
Expand All @@ -7,6 +8,7 @@ export interface TypographyProps extends React.HTMLAttributes<HTMLSpanElement> {
size?: 25 | 50 | 75 | 100 | 200 | 300 | 400 | 500 | 600;
underline?: boolean;
color?: string;
userSelect?: Property.UserSelect;
}

const withTypography = (type: 'strong' | 'medium' | 'normal'): FC<TypographyProps> => {
Expand All @@ -18,6 +20,7 @@ const withTypography = (type: 'strong' | 'medium' | 'normal'): FC<TypographyProp
color: color,
textDecorationLine: underline ? 'underline' : 'unset',
cursor: underline ? 'pointer' : 'unset',
userSelect: props.userSelect || 'auto',
...style,
}}
weight={type}
Expand Down

0 comments on commit 3dec117

Please sign in to comment.