diff --git a/packages/palette-docs/content/docs/tokens/Typography.mdx b/packages/palette-docs/content/docs/tokens/Typography.mdx index c808d6c5f..173c6a6fb 100644 --- a/packages/palette-docs/content/docs/tokens/Typography.mdx +++ b/packages/palette-docs/content/docs/tokens/Typography.mdx @@ -9,152 +9,26 @@ should be contextually applied. The goal is for this system to increase overall design consistency for our product as well as to increase efficiency for both the design and engineering teams. - + - Sans 16 - Sans 14 - Sans 12 - Sans 10 - Sans 8 - Sans 6 - Sans 5t - Sans 5 - Sans 4t - Sans 4 - Sans 3t - Sans 3 - Sans 2 - Sans 1 + Text largeTitle + Text title + Text subtitle + Text text + Text mediumText + Text caption + Text small - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. - - - - - - - - - - - - Sans 16 - Sans 14 - Sans 12 - Sans 10 - Sans 8 - Sans 6 - Sans 5t - Sans 5 - Sans 4t - Sans 4 - Sans 3t - Sans 3 - Sans 2 - Sans 1 - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. - - - - - - - - - - - - Serif 12 - Serif 10 - Serif 8 - Serif 6 - Serif 5t - Serif 5 - Serif 4t - Serif 4 - Serif 3t - Serif 3 - Serif 2 - Serif 1 - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. - - - - - - - - - - - Serif 12 - Serif 10 - Serif 8 - Serif 6 - Serif 5t - Serif 5 - Serif 4t - Serif 4 - Serif 3t - Serif 3 - Serif 2 - Serif 1 - - + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - + - - - - - - - - - This is an h1 - - - This is an h2 - - - And this content is all within a p. - - - - - - - - - - {range("$10k", "$20k")} - - diff --git a/packages/palette/src/elements/Text/Text.story.tsx b/packages/palette/src/elements/Text/Text.story.tsx index e6d9814f0..f9a2fae7c 100644 --- a/packages/palette/src/elements/Text/Text.story.tsx +++ b/packages/palette/src/elements/Text/Text.story.tsx @@ -131,7 +131,6 @@ storiesOf("Components/Text", module) letterSpacing: "tightest", }, { - fontFamily: "serif", fontSize: "70px", lineHeight: "solid", letterSpacing: "tight", @@ -143,13 +142,15 @@ storiesOf("Components/Text", module) letterSpacing: "tightest", }, { - fontFamily: "serif", fontSize: "55px", lineHeight: "solid", letterSpacing: "tightest", }, - { fontFamily: "serif" }, - ] + { + variant: 'text', + lineHeight: 'solid' + } + ] as const return ( @@ -181,3 +182,15 @@ storiesOf("Components/Text", module)
) }) + .add("overflowEllipsis", () => { + return ( + + All their equipment and instruments are alive. All their equipment and + instruments are alive. All their equipment and instruments are alive. + All their equipment and instruments are alive. All their equipment and + instruments are alive. All their equipment and instruments are alive. + All their equipment and instruments are alive. All their equipment and + instruments are alive. All their equipment and instruments are alive. + + ) + }) diff --git a/packages/palette/src/elements/Text/Text.tsx b/packages/palette/src/elements/Text/Text.tsx index 838a05631..c51e2a825 100644 --- a/packages/palette/src/elements/Text/Text.tsx +++ b/packages/palette/src/elements/Text/Text.tsx @@ -1,20 +1,27 @@ import { themeGet } from "@styled-system/theme-get" +import styled, { css } from "styled-components" import { variant } from "styled-system" -import { styled as primitives } from "../../platform/primitives" import { textMixin, TextProps } from "./Text.shared" import { TEXT_VARIANTS } from "./tokens" -/** - * Text - */ -export const Text = primitives.Text` +/** Adds ellipsis to overflowing text */ +export const overflowEllipsisMixin = css` + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +` + +/** Text */ +export const Text = styled.div` ${variant({ variants: TEXT_VARIANTS.small })} + ${textMixin} @media (min-width: ${themeGet("breakpoints.0")}) { ${variant({ variants: TEXT_VARIANTS.large })} + ${textMixin} } - ${textMixin} + ${({ overflowEllipsis }) => overflowEllipsis && overflowEllipsisMixin} ` Text.displayName = "Text" diff --git a/packages/palette/src/elements/Text/tokens.ts b/packages/palette/src/elements/Text/tokens.ts index 6ecd8be9d..a25e4fe7a 100644 --- a/packages/palette/src/elements/Text/tokens.ts +++ b/packages/palette/src/elements/Text/tokens.ts @@ -5,5 +5,4 @@ export * from "./tokens.shared" */ export const TEXT_FONTS = { sans: '"ll-unica77", "Helvetica Neue", Helvetica, Arial, sans-serif', - serif: '"adobe-garamond-pro", "Times New Roman", Times, serif', }