@patreon/studio
Version:
Patreon Studio Design System
24 lines (23 loc) • 632 B
JavaScript
import { css } from 'styled-components';
/**
* Generate CSS for text ellipsis.
*/
export const cssForEllipsis = ({ lines }) => css `
display: block;
overflow: hidden;
text-overflow: ellipsis;
${lines
? // when line clamp is set, use the -webkit-box method
// to clamp the text to the specified number of lines
css `
display: -moz-box;
display: -webkit-box;
-webkit-line-clamp: ${lines};
-webkit-box-orient: vertical;
`
: // otherwise, use the single line ellipsis method
css `
white-space: nowrap;
`}
`;
//# sourceMappingURL=index.js.map