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 editor color palettes and secondary color by adding full, 6-digits, hex codes #857

Merged
merged 2 commits into from
Mar 31, 2020

Conversation

thomasguillot
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

The function newspack_get_color_contrast() in inc/template-functions.php requires hex codes with a 6 digits. Hex codes with 3 digits wouldn't work and we wouldn't get the correct contrast color.

How to test the changes in this Pull Request:

I randomly found the issue with Newspack Popups but it can be replicated like so:

  • Activate Nelson
  • Set header to solid background
  • Change default colours to whatever you want
  • In themes/newspack-nelson/inc/child-color-patterns.php, L22-23, replace $header_color = $primary_color; $header_color_contrast = newspack_get_color_contrast( $primary_color ); with $header_color = '#fff'; $header_color_contrast = newspack_get_color_contrast( '#fff' );
  • Check your theme. You shouldn't be able to see any text in your header.
  • Change $header_color = '#fff'; $header_color_contrast = newspack_get_color_contrast( '#fff' ); to $header_color = '#ffffff'; $header_color_contrast = newspack_get_color_contrast( '#ffffff' );

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@thomasguillot thomasguillot added the [Status] Needs Review The issue or pull request needs to be reviewed label Mar 30, 2020
Copy link
Contributor

@laurelfulford laurelfulford left a comment

Choose a reason for hiding this comment

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

Good catch, Thomas!

This looks good to me.

@laurelfulford laurelfulford added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Mar 30, 2020
@thomasguillot thomasguillot merged commit 0c800a1 into master Mar 31, 2020
@thomasguillot thomasguillot deleted the fix/editor-color-palettes branch March 31, 2020 07:47
matticbot pushed a commit that referenced this pull request Apr 1, 2020
# [1.4.0](v1.3.0...v1.4.0) (2020-04-01)

### Bug Fixes

* correct menu name when checking for it in header ([#859](#859)) ([b560b28](b560b28))
* CSS changed by release process ([abb4bf0](abb4bf0))
* editor color palettes and secondary color by adding full, 6-digits, hex codes ([#857](#857)) ([0c800a1](0c800a1))
* make related posts styles more consistent between formats ([#761](#761)) ([b55746d](b55746d))
* make sure social links block doesn't inherit link color ([#846](#846)) ([66c927c](66c927c))
* only apply RSS icon to /feed ([#851](#851)) ([ce884ac](ce884ac))

### Features

* add a desktop slideout widget area ([#816](#816)) ([3ed6c77](3ed6c77))
* add option to collapse comments ([#820](#820)) ([f67ab51](f67ab51))
* add telephone icon to social menu ([#849](#849)) ([9812b28](9812b28))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants