Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fontSize theme override #222

Open
jamesgrubb opened this issue Jul 18, 2019 · 1 comment
Open

fontSize theme override #222

jamesgrubb opened this issue Jul 18, 2019 · 1 comment

Comments

@jamesgrubb
Copy link

I'm using kirkham theme with some overrides.

kirkhamTheme.overrideThemeStyles = ({scale, rhythm }) => ({
    "h1" : {
        marginBottom: rhythm(10),
        marginTop: rhythm(2),
        fontSize: scale(3)
    }
})

when I inspect the code it seems font size is output as an object rather than css readabel code

fontSize{font-size: 9.93837rem;
    line-height: 10.8rem;
    }
@mbao01
Copy link
Contributor

mbao01 commented Nov 12, 2019

Hello @jamesgrubb I took a look at the overrideThemeStyles API.
The scale method returns a BaseLine type which is an object containing font-size and line-height

What you need to do is spread scale(3). Here;

kirkhamTheme.overrideThemeStyles = ({scale, rhythm }) => ({
    "h1" : {
        marginBottom: rhythm(10),
        marginTop: rhythm(2),
        ...scale(3)
    }
})

overrideThemeStyles: (VerticalRhythm: VerticalRhythm, . . . ) signature

baseline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants