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

NOPS-619: Fix syndication icons alignment #86

Merged
merged 3 commits into from
Jul 22, 2021

Conversation

joelcarr
Copy link
Member

@joelcarr joelcarr commented Jul 16, 2021

A fix to ensure that the syndication icons have a consistent alignment with its' sibling inline elements.

Currently we have a few overrides to try an ensure there is a fixed value for the vertical-align rule however seems to be a symptom of oIconsContent(...) resetting the base icon style rules. This fix uses the $include-base-styles: false option that removes these base icon style rules removing the need to override the vertical-align rule for different variations. This fix also adds the vertical-align: middle rule to any sibling of .n-syndication-icon to make sure the alignment between these inline elements is consistent.

Closes #82 as this will remove the duplicated vertical-align overrides to create one consistent (🤞 ) style.

Here is some screen recordings of the new syndication icon layout (in maintenance mode) for Chrome, Safari, Firefox, and iOS Safari:

syndication-icons-chrome.mov
syndication-icons-firefox.mov
syndication-icons-ios.mov
syndication-icons-safari.mov

joelcarr added 3 commits July 16, 2021 14:10
By adding $include-base-styles to our modifying syndication icons, we
will no longer duplicate the rules already defined on the class
`n-syndication-icons`. This will help to remove removes 33 lines of
duplicated rules.

https://registry.origami.ft.com/components/o-icons@7.0.1/readme?brand=master#includes-icons-of-different-sizes-and-colors
Align the syndication icon and its sibling elements (which are inline)
to the middle of each other. This will ensure that the icon and other
inline elements will line up with each other regardless of the size. If
the icon is much bigger than the sibling text - the top line of the
subsequent text will line up to the middle of the icon, and visa versa.

On a slight tangent - how wonderful is this "how to Vertically Center
Content" page http://phrogz.net/css/vertical-align/index.html
Now we are not repeat the base styles of the icons, we do not need to
override the syndication icons vertical alignment.
@joelcarr joelcarr changed the title NOPS-619: Fix syndication icons NOPS-619: Fix syndication icons alignment Jul 16, 2021
@binaryberry
Copy link

binaryberry commented Jul 19, 2021

Reposted from Slack:
Ania Bebb:
I had a quick look and some of the lines are deleted but not obviously replaced - I presume they have been replaced at a different level?

Joel Carr:
That is correct, the class .n-sydnication-icon was adding the same rules repeatedly when using @include oIconsContent but all these extra classes share the class of .n-syndication-icon so we are removing all this duplication with $include-base-styles: false

@magsallen
Copy link
Contributor

This looks much better! Has it been tested in other browsers yet or just in Chrome? It would be good to check that removing the base styles doesn't have any unexpected consequences
when the browser style sheet changes https://github.com/Financial-Times/next/wiki/Browser-Support

@joelcarr joelcarr marked this pull request as ready for review July 21, 2021 09:24
@joelcarr joelcarr requested a review from a team July 21, 2021 09:24
@joelcarr
Copy link
Member Author

I have been able to test the new icon layout locally using the syndication maintenance mode. Unfortunately there is some complications to run/develop this package locally without maintenance mode. @Financial-Times/accounts have discussed that this can be enough in order to merge this fix as long as we are ready to revert in production if it looks wrong. I have created ACC-1156 to look into how to develop this package locally and document it for all.

Copy link
Contributor

@AniaMakes AniaMakes left a comment

Choose a reason for hiding this comment

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

It looks a bit wrong now, I don't think people will complain even if it looks a bit different but still wrong 🤷🏻 I'm happy to 🚢 !

Copy link

@binaryberry binaryberry left a comment

Choose a reason for hiding this comment

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

Nice multi-browser testing with videos to boot! Looks good!

@joelcarr joelcarr merged commit ab95ef8 into main Jul 22, 2021
@joelcarr joelcarr deleted the NOPS-619-fix-syndication-icons branch July 22, 2021 13:35
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.

4 participants