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

Safari CSS gradient bug #14311 #14938

Merged
merged 3 commits into from Oct 13, 2021
Merged

Safari CSS gradient bug #14311 #14938

merged 3 commits into from Oct 13, 2021

Conversation

valtism
Copy link
Contributor

@valtism valtism commented Oct 5, 2021

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Transition to a transparent version of the same background color with
no opacity so that safari transitions through correctly.

Switch all --story-comments-bg themes to hexadecimal, fixes no fade bug
in "Pink" theme.

Related Tickets & Documents

Closes #14311

QA Instructions, Screenshots, Recordings

Please see the linked issue for screenshots of the issue and how it should look with this fix.

Added/updated tests?

  • Yes
  • No, and this is why: I don't think this CSS change needs tests.
  • I need help with writing tests

@valtism valtism requested a review from a team October 5, 2021 10:36
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 5, 2021
@valtism valtism requested review from Ridhwana and msarit and removed request for a team October 5, 2021 10:36
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2021

Thank you for opening this PR! We appreciate you!

For all pull requests coming from third-party forks we will need to
review the PR before we can process it through our CI pipelines.

A Forem Team member will review this contribution and get back to
you as soon as possible!

@valtism
Copy link
Contributor Author

valtism commented Oct 5, 2021

Apologies, was updating the last PR and didn't realise that if I force-pushed then git would no longer be able to track it in the same PR.

@ludwiczakpawel I addressed the points you made here: #14893 (review)

I would have liked to use the premade colours with opacity, but the base values I was working with were already flat variants based off base colours with some transparency. They could not be used like that because they were being used for a fade overlay and had to transition from totally opaque to transparent.

Copy link
Contributor

@aitchiss aitchiss left a comment

Choose a reason for hiding this comment

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

This is looking good, but I noticed it looks like the background of the overall comments container has changed, so now the gradient looks a bit like it's the wrong colour (since the colour only becomes visible right at the end) 🤔

Light before:
gray box covers all of the comments area

Light after:
only a small gray section is visible in the middle of the comments box

Dark before:

blue-ish colour across all comments box

Dark after:

blue-ish colour only appears at end of comments box

@valtism
Copy link
Contributor Author

valtism commented Oct 7, 2021

@aitchiss Thanks so much for testing this 🙏 I tried to set the repo up locally, but ran into lots of errors. Since it was a simple change, I thought I could pull it off without making mistakes but here we are. Just needed to change once var ref to process the new color with rgb() since we're not using hex values any more.

@aitchiss
Copy link
Contributor

aitchiss commented Oct 8, 2021

Looks like some of the tests are failing with e.g.

An error occurred while loading ./spec/services/users/create_mascot_account_spec.rb.
Failure/Error: background: rgb(var(--story-comments-bg));
SassC::SyntaxError:
  Error: Function rgb is missing argument $green.
          on line 30:9 of app/assets/stylesheets/crayons.scss
          from line 2:9 of app/assets/stylesheets/admin.scss
  >>     background: rgb(var(--story-comments-bg));
     ----------------^
# ./app/assets/stylesheets/components/stories.scss:196
# ./app/lib/url.rb:71:in `local_image'
# ./app/models/settings/general.rb:49:in `block in <class:General>'
# ./app/models/settings/base.rb:70:in `block in define_setting'
# ./app/services/users/create_mascot_account.rb:7:in `<class:CreateMascotAccount>'
# ./app/services/users/create_mascot_account.rb:2:in `<module:Users>'
# ./app/services/users/create_mascot_account.rb:1:in `<main>'
# ./spec/services/users/create_mascot_account_spec.rb:3:in `<main>'

I had a quick check locally and it seems like in sass when you pass a CSS variable to rgb or rgba it treats the variable as the 'red' argument only 🙈 It seems to be a known issue: sass/node-sass#2251

We can work around it by using RGB(var(--variable-name)) instead of lowercase. It's not great, but I guess if it does the job...

@valtism
Copy link
Contributor Author

valtism commented Oct 8, 2021

@aitchiss Wow, thank you for being so patient and helpful. Your kindness motivated me to spend a couple of hours working out the install errors and getting forem set up locally.

The fix you found works well and everything seems ok now. I wasn't able to get authentication set up locally to create a user and change themes, but changing the variables directly to test on pasted-in content looks good:

image

@ludwiczakpawel
Copy link
Contributor

ludwiczakpawel commented Oct 11, 2021

I wasn't able to get authentication set up locally to create a user

@valtism you should be able to login with admin@forem.local / password credentials without setting up authentication methods :) (as long as I understand our own docs correctly :))

Also, kudos for installing forem locally!! 🙌

Copy link
Contributor

@aitchiss aitchiss left a comment

Choose a reason for hiding this comment

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

This is looking great ✨ I checked each theme in Chrome/Safari/Firefox and it all looks great to me - nice work!

Glad to hear you got Forem up and running locally like Pawel mentioned you should then be able to log in with:

username: admin@forem.local
password: password

If you have any difficulty though, don't hesitate to let us know - hopefully having your environment set up now will be useful for future PRs 😉

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 11, 2021
Copy link
Contributor

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @valtism! 🚀

@nickytonline nickytonline merged commit 0b8338f into forem:main Oct 13, 2021
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Safari CSS gradient bug
4 participants