Commit 0f0353f0 authored by Audrey Hamelers's avatar Audrey Hamelers

refactor(ui): deprecate Title

Title should be abandoned in favor of Heading

BREAKING CHANGE: Anyone applying styles using a div css selector will have to change to using an
h-level css selecto
parent 5b264c98
Pipeline #13176 failed with stages
in 12 minutes and 25 seconds
import styled from 'styled-components'
import { th, override } from '@pubsweet/ui-toolkit'
import React from 'react'
import { Heading } from './Heading'
// Deprecated! Please use Heading instead
const Title = ({ level }) => <Heading level={level} />
const fontSize = ({ theme, level = 1 }) =>
({
1: theme.fontSizeHeading1,
2: theme.fontSizeHeading2,
3: theme.fontSizeHeading3,
4: theme.fontSizeHeading4,
5: theme.fontSizeHeading5,
6: theme.fontSizeHeading6,
}[level])
const lineHeight = ({ theme, level = 1 }) =>
({
1: theme.lineHeightHeading1,
2: theme.lineHeightHeading2,
3: theme.lineHeightHeading3,
4: theme.lineHeightHeading4,
5: theme.lineHeightHeading5,
6: theme.lineHeightHeading6,
}[level])
const Title = styled.div`
font-size: ${fontSize};
font-family: ${th('fontHeading')};
line-height: ${lineHeight};
margin-bottom: calc(${th('gridUnit')} * 3);
${override('ui.Title')};
`
/**
* @component
*/
export default Title
Deprecated: use Heading
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment