Skip to content

Conversation

it-jhack
Copy link
Contributor

@it-jhack it-jhack commented Nov 6, 2022

Summary

Feature
Added option to specify font-weight, as available on Google Fonts.

Type of change

  • New feature (added a non-breaking change which adds functionality)

How Has This Been Tested?

It has been tested locally, manually and by running composer test
I believe it's not necessary to create additional tests for this feature

  • Ran tests with composer test
  • Added or updated test cases to test new features (No)

@DenverCoder1 DenverCoder1 linked an issue Nov 6, 2022 that may be closed by this pull request
@DenverCoder1 DenverCoder1 added the enhancement New feature or request label Nov 6, 2022
Copy link
Owner

@DenverCoder1 DenverCoder1 left a comment

Choose a reason for hiding this comment

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

Looks great! I just have a couple suggestions.

@@ -52,6 +55,7 @@ class RendererModel
/** @var array<string, string> $DEFAULTS */
private $DEFAULTS = [
"font" => "monospace",
"weight" => "400",
Copy link
Owner

@DenverCoder1 DenverCoder1 Nov 6, 2022

Choose a reason for hiding this comment

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

In demo/js/script.js there is also a place to add defaults for the demo site that makes the URL shorter when the default value is used.

If you could add weight: "400", to the defaults object in that file as well that would be great. You can edit that on your forked branch.

(Btw for the future, it's typically better to create a new branch in your fork before working on a feature, rather than pushing to main since it allows you to have main kept up to date with the original repo and work on multiple features on separate branches. It's totally fine in this case, just a tip for going forward 😄).

Copy link
Contributor Author

@it-jhack it-jhack Nov 6, 2022

Choose a reason for hiding this comment

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

Will do!
Thank you very much for the detailed feedback. I actually did work on a separate branch "feat-font-weight" that had only 2 commits, but I merged it to my "main" when I finished and used that for the PR. So the ideal would be to PR my "feat-font-weight" directly to your "main"?

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, best is to create a branch for the PR and create the PR from that feature branch to the upstream repo's main. Then updating that feature branch will also update the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just updated the demo default on a new branch and merged into my main, not sure if I did it the proper way 😬

Copy link
Owner

@DenverCoder1 DenverCoder1 Nov 6, 2022

Choose a reason for hiding this comment

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

As long as it all ends up on the right branch eventually, it's fine.

image

In this case the source branch of the PR is main, so all new commits to the PR would go there.

If you created the PR from a separate branch, then that separate branch would be where the new commits go.

Copy link
Owner

@DenverCoder1 DenverCoder1 left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for the contribution 🎉

@DenverCoder1 DenverCoder1 changed the title feature: font-weight feature: Added font-weight support Nov 6, 2022
@DenverCoder1 DenverCoder1 merged commit 6662cc0 into DenverCoder1:main Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Font-weight support for Google Fonts
2 participants