Skip to content

Commit 27e6aa5

Browse files
committed
feat: new typo variant
1 parent 5c5e2c3 commit 27e6aa5

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

example/src/stories/Typo.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default {
3333
'readable',
3434
'no-ligatures',
3535
'no-margin',
36+
'ellipsis',
3637
],
3738
},
3839
description: 'The variant of the text',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solved-ac/ui-react",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"description": "React component library used by solved.ac",
55
"author": "shiftpsh",
66
"license": "MIT",

src/components/Typo.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { css } from '@emotion/react'
22
import styled from '@emotion/styled'
3+
import { ellipsis } from 'polished'
34
import React, { ElementType } from 'react'
45
import { SolvedTheme, solvedThemes } from '../styles'
56
import { PC, PP, PR } from '../types/PolymorphicElementProps'
@@ -27,6 +28,7 @@ const variants = (theme: SolvedTheme) =>
2728
`,
2829
h1: css`
2930
display: block;
31+
word-break: keep-all;
3032
font-weight: 800;
3133
font-size: 2em;
3234
letter-spacing: -0.04ch;
@@ -37,6 +39,7 @@ const variants = (theme: SolvedTheme) =>
3739
`,
3840
h2: css`
3941
display: block;
42+
word-break: keep-all;
4043
font-weight: 800;
4144
font-size: 1.5em;
4245
letter-spacing: -0.02ch;
@@ -47,6 +50,7 @@ const variants = (theme: SolvedTheme) =>
4750
`,
4851
h3: css`
4952
display: block;
53+
word-break: keep-all;
5054
font-weight: 800;
5155
font-size: 1.2em;
5256
margin-block-start: 1em;
@@ -102,6 +106,9 @@ const variants = (theme: SolvedTheme) =>
102106
'no-margin': css`
103107
margin: 0;
104108
`,
109+
ellipsis: css`
110+
${ellipsis()}
111+
`,
105112
} as const)
106113

107114
const variantKeys = Object.keys(variants(solvedThemes.light))

0 commit comments

Comments
 (0)