Skip to content

Commit

Permalink
feat(atoms): add ellipsis modifier to the Text component
Browse files Browse the repository at this point in the history
  • Loading branch information
ej9x committed Aug 8, 2018
1 parent c89e9e5 commit 83018c5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/atoms/typography/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type TextProps = {|
size?: PropSizes,
/** text align */
align?: 'left' | 'center' | 'right',
/** when true then cut text with ellipsis */
ellipsis?: boolean,
|};

const name = 'text';
Expand Down Expand Up @@ -88,11 +90,19 @@ const theme = createTheme(name, (colors: *): * => ({
fontSize: '1.8rem',
},
},

ellipsis: {
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
},
},

defaults: {
color: 'primary',
size: 'md',
weight: 'normal',
ellipsis: false,
},
}));

Expand Down

0 comments on commit 83018c5

Please sign in to comment.