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

Plugin uses default Tailwind colors #29

Closed
RubenVanEldik opened this issue Jul 16, 2020 · 3 comments
Closed

Plugin uses default Tailwind colors #29

RubenVanEldik opened this issue Jul 16, 2020 · 3 comments

Comments

@RubenVanEldik
Copy link

I have custom gray values for Tailwind, but the Typography plugin still uses the default gray values. Is this expected behaviour?

Looking at the computed CSS colors they appear to all be the standard Tailwind gray colors (gray-100, gray-700, and gray-900, etc.). I know that these standard colors are hand picked, but it would be awesome if the Typography plugin would automatically use the custom colors so the prose sections are more aligned with the style of the site. I am super new to Tailwind, so I don't know this technically is possible.

@RomainMazB
Copy link

RomainMazB commented Jul 16, 2020

Hi @RubenVanEldik ,
I've just looked into the sources for another thing and land on your issue just before go away.

It looks like it's the expected behaviour but you can override it using the theme, even if it would be fastidious (you'll need to override 20 properties):

module.exports = {
    theme: {
        typography: {
            default: {
                css: {
                    color: yourGray[700],
                    a: {
                        color: yourGray[700]
                    }
                    // ...
                },
            },
        },
    }
}

@RubenVanEldik
Copy link
Author

@RomainMazB Thank you for your quick response!

I understand now why this is expected behaviour. I'll customize it manually for now.

It might be a good idea to have a plugin option to use the custom colors instead of the default colors, since the colors are probably the main thing people would like to customize. @adamwathan would you be open for a pull request for this?

@adamwathan
Copy link
Member

For now I'd like to keep the customization stuff as-is, as even if we did support a way to just use the user's color config instead of the default there is no way of guaranteeing the styles even exist, or that they have the right perceived brightness to even look correct. I think it's simpler to just let people override the colors using the current API for now than to try and get too clever with that stuff.

Eventually we'd like to add some higher-level options so you can just do stuff like bodyColor: #444 or headingColor: #000. We nested all of the existing options under css to reserve the root-level for ideas like this once we have a better sense of exactly what we should provide 👍

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

3 participants