Skip to content

Typography.js plugin overrideStyles not called #1969

Open
@LeonardoGentile

Description

It seems that Typography.js overrideStyles function defined inside the themes is not called when calling toTheme.

Example

import { toTheme } from '@theme-ui/typography'
import wp2016 from 'typography-theme-wordpress-2016'

const theme = toTheme(wp2016)

wp2016 defines an overrideStyles function that will modify part of the theme when instantiated with plain typography package.

For example, for the wp2016 theme :

overrideStyles: ({ adjustFontSizeTo, scale, rhythm }, options) => ({
    h1: {
      fontFamily: ["Montserrat", "sans-serif"].join(","),
    },
   // ...

but this function is never called by toTheme and so h1 will result to have the default

headerFontFamily: ["Merriweather", "Georgia", "serif"],

not the Montserrat family as defined by overrideStyles.

This means that Typography.js themes will be slightly different when used in theme-ui, isn't it?
Or am I missing somethings?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions