Skip to content

[Footer]: Fix footer social icon hit area#1248

Closed
joshbruce wants to merge 6 commits into
uswds:stagingfrom
joshbruce:fix-footer-social-icon-hit-area
Closed

[Footer]: Fix footer social icon hit area#1248
joshbruce wants to merge 6 commits into
uswds:stagingfrom
joshbruce:fix-footer-social-icon-hit-area

Conversation

@joshbruce

Copy link
Copy Markdown

Description

Fixes #346

Additional information

  • This PR uses display: inline-block to allow setting height and
    width to an inline element.
  • Uses 44 pixels for both height and width per the Apple iOS HIG
  • Concerns with text-align: right - could result in thumb hitting to
    the right of the hit area - actually hitting the icon to the right of
    the actual target. text-align: center used instead.
  • Using text-align: center causes the right alignment of the icons to
    be off when compared “Agency Contact Center” text. position: relative; left: 13px used in order to compensate. Slight concern that this could
    cause a horizontal scroll bar to appear on mobile - though, given the
    overall alignment of the social-links container - concern may be moot.

Josh Bruce added 4 commits May 27, 2016 10:44
## Description

Fixes #346

## Additional information

* This PR uses `display: inline-block` to allow setting height and
width to an inline element.
* Uses 44 pixels for both height and width per the Apple iOS HIG
* Concerns with `text-align: right` - could result in thumb hitting to
the right of the hit area - actually hitting the icon to the right of
the actual target. `text-align: center` used instead.
* Using `text-align: center` causes the right alignment of the icons to
be off when compared “Agency Contact Center” text. `position: relative;
left: 13px` used in order to compensate. Slight concern that this could
cause a horizontal scroll bar to appear on mobile - though, given the
overall alignment of the `social-links` container - concern may be moot.
@joshbruce

Copy link
Copy Markdown
Author

text-align: right

screen shot 2016-06-09 at 3 30 36 pm

text-align: center

screen shot 2016-06-09 at 3 30 20 pm

text-align: right

screen shot 2016-06-09 at 3 30 48 pm

text-align: center

screen shot 2016-06-09 at 3 30 55 pm

PR solution: text-align: center & left: 13px

screen shot 2016-06-09 at 3 32 05 pm

PR solution: text-align: center & left: 13px

screen shot 2016-06-09 at 3 39 48 pm

@joshbruce

Copy link
Copy Markdown
Author

@colinpmacarthur - Just wanted to let you know and get your thoughts.

@maya

maya commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

@joshbruce thanks for opening this PR! Just wanted to bring up this currently closed issue #706 with new footer designs. In this design, we're using larger icons to expand the hit area. But your solution of just expanding the hit area and keeping the icons the same size also works. Mostly, I'd like to know which approach our designers prefer - @ericadeahl @bradnunnally

@joshbruce

Copy link
Copy Markdown
Author

@maya - Thanks! I like that design direction a great deal. I don't see a specified height and width in the comp for the icons or the resulting hit area.

Having said that, this setup could be used as a foundation for #706. If either dimension is less than 44px; or, we could maintain a square hit area - matching width (seems the smaller of the two) to height.

@ericadeahl

Copy link
Copy Markdown

@maya Sounds good to me to keep the larger icons and also make sure the hit area is at least 44px in width and height.

It looks to me like the design files already have the larger icons incorporated, but the Standards site still uses the smaller ones.

@maya

maya commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

@ericadeahl thanks for checking! I left a note in the issue #346 to use the larger icons and will be closing this PR.

@maya maya closed this Jun 9, 2016
@maya

maya commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

@joshbruce sorry if I closed this too early, let me know if you'd like to implement the larger icons on this PR and I'd be happy to reopen.

@joshbruce

joshbruce commented Jun 10, 2016

Copy link
Copy Markdown
Author

@maya - I should be able to do that.

Because we are using SVG, I should be able to just change the dimensions - and update the hit area to accommodate.

From what I can tell, the "larger" icons are not modified structurally from those already used, is that a correct assumption?

If you reopen the PR I should be able to make the minor modifications to get us there.

@maya

maya commented Jun 10, 2016

Copy link
Copy Markdown
Contributor

@joshbruce sure! It's SVG + PNG fallback if you look at the markup.

Also, CSS properties must be alphabetized and use REM/EM values (per https://pages.18f.gov/frontend/css-coding-styleguide/)

@maya maya reopened this Jun 10, 2016
@joshbruce

Copy link
Copy Markdown
Author

@maya - Thanks! Sorry for missing the PNG fallback - skimming the code quickly. :)

Curious to know the rationale regarding the alphabetical ordering as opposed to groupings similar to: http://codeguide.co/#css-declaration-order - I'm not always good at doing this, but it is how I typically look at things.

I should be able to do the update next week. I might end up submitting an alternative PR to accomplish the same thing, just a little more flexibility, imho.

@joshbruce

Copy link
Copy Markdown
Author

@ericadeahl - I cloned https://github.com/18F/web-design-standards-assets - I'm not sure if I'm seeing the larger icon set in there - can you give me the target dimensions for the icons (sorry, I don't see the dimensions in the comp from #706)?

The Facebook icon width:height in the AI file I have is ~ 13:27 pixels.
The files stored in /src/img/social-icons/png are 77:52. And the images displayed are at 26:39.

@maya

maya commented Jun 15, 2016

Copy link
Copy Markdown
Contributor

Curious to know the rationale regarding the alphabetical ordering as opposed to groupings similar to: http://codeguide.co/#css-declaration-order

Good question! We find it's easier to find where properties are when it's alphabetical and easier for people to meet the standards and to review and lint - especially on such a large code base with external contributors. Our coding styleguide says we can use either on a project as long as it's consistent, but we've gone with alphabetical for the previous reasons.

@ericadeahl

Copy link
Copy Markdown

@joshbruce Sorry for the confusion; we haven't implemented the comps from #706. The larger icon size I was referring to is the one from the current Illustrator file (see screenshot.) The icons there appear to be larger than the ones on standards.usa.gov.

The dimensions from the design file are (approximately):

screen shot 2016-06-15 at 1 25 43 pm
14:27 / 26:20 / 24:29 / 23:23
(all in pixels)

@maya

maya commented Jun 15, 2016

Copy link
Copy Markdown
Contributor

We've also been using 2x pixel sizes for retina screens.

- changed icon base sizes
- made 2x for high-density displays
- converted to rem
- hit area larger than 44px
@joshbruce

Copy link
Copy Markdown
Author

screen shot 2016-06-16 at 1 32 32 pm

screen shot 2016-06-16 at 1 32 46 pm

@maya

maya commented Jun 16, 2016

Copy link
Copy Markdown
Contributor

@joshbruce you should be able to do that with the svg and img size and do not need to change the svg files.

@joshbruce

Copy link
Copy Markdown
Author

See also: #1262

@rogeruiz

Copy link
Copy Markdown
Contributor

@joshbruce Looks like you'll need to rebase this branch onto the latest work on staging. #1261 has removed screener and that will get this PR to pass in CircleCI. If it's helpful, I can rebase these changes manually and submit a new pull request with that update. Thanks!

@maya

maya commented Jun 20, 2016

Copy link
Copy Markdown
Contributor

@rogeruiz Looks like we're going with #1262. Closing this so it's clearer.

@rogeruiz

Copy link
Copy Markdown
Contributor

Awesome, thanks @maya

@joshbruce

Copy link
Copy Markdown
Author

Thanks @maya and @rogeruiz - was waiting for the merge or definitive yay/nay to close it myself.

Thanks again.

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.

5 participants