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

fix(typography): Prepend styles to <head> instead of placing them at end, possibly overwriting user styles #201

Merged
merged 5 commits into from
Mar 7, 2019

Conversation

DSchau
Copy link
Contributor

@DSchau DSchau commented Mar 6, 2019

Adds the ability to prepend with injectStyles.

I made this opt-in (with a boolean) so that the existing behavior will remain, unless explicitly tweaked. That being said--this seems like a fix for confusing behavior, so I'd be happy to make this the default if we're comfortable with potential breaking changes.

@DSchau
Copy link
Contributor Author

DSchau commented Mar 6, 2019

@KyleAMathews there's some noise here re: prettier. I can revert f235c11, but I'm sure you get the idea.

Also looks like Travis fails in Node 6, but not related to the changes in this PR 🤷‍♂️

Copy link
Owner

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dustin! This might be a breaking change for some use cases — it's clearly not the expected behavior given the volume of bug reports we get on Gatsby about typography.js unexpectedly overwriting their styles — so let's change the typopgraphy.js styles to always be placed first in the head.

@KyleAMathews KyleAMathews changed the title fix(typography): add ability to prepend to beginning of head tags fix(typography): Prepend styles to <head> instead of placing them at end, possibly overwriting user styles Mar 7, 2019
@KyleAMathews
Copy link
Owner

Also added a .prettierrc to avoid prettier-related changes in the future.

@KyleAMathews KyleAMathews merged commit f43857b into KyleAMathews:master Mar 7, 2019
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

Successfully merging this pull request may close these issues.

2 participants