Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(Icon): Redlining icons #441

Merged
merged 21 commits into from
Nov 14, 2018
Merged

feat(Icon): Redlining icons #441

merged 21 commits into from
Nov 14, 2018

Conversation

codepretty
Copy link
Collaborator

Icon style updates for Teams theme

The style updates for Teams icons is mostly around the size of the icons. The normal (default) Icon size matches the Teams spec of being a 16px x 16px space. Other size variations of Icons will be addressed in a future PR.

Before
image

After
This shows the size update for both SVGs and Icon fonts.
image

Filled and Outline versions of Teams Icon

Part of this PR includes updates to show either a filled or outline version of the icon.
image

API update

<Icon name="call-video" />
<Icon name="call-video" variables={{ outline: true }} />

Changing viewBox for Teams SVGs

We're changing the viewBox of all (or most?) Teams icons. Default icons are built with built-in padding, a viewBox of 32x32px and a 16x16px icon size. We changed the viewBox to remove the bounding box and just have the icon, which remains the same 16x16px size.

The reason for this is because if you want an icon to appear to not have any space you would need to do some negative margin hacks.

Before
image

Now
image


Question: Are the icons examples too tied to Teams theme? In a default theme, what would the expectation be if there is no icon provider shown? Today, it fails silently by not showing anything which feels right to me, but wanted to get others opinions..

@kuzhelov kuzhelov added 🚧 WIP redlines Update of the redlines for the mentioned component labels Nov 7, 2018
@codepretty codepretty changed the title [WIP] feat(Icon): Redlining icons feat(Icon): Redlining icons Nov 7, 2018
@codecov
Copy link

codecov bot commented Nov 7, 2018

Codecov Report

Merging #441 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #441   +/-   ##
======================================
  Coverage    89.2%   89.2%           
======================================
  Files          41      41           
  Lines        1417    1417           
  Branches      202     177   -25     
======================================
  Hits         1264    1264           
  Misses        149     149           
  Partials        4       4
Impacted Files Coverage Δ
src/components/Status/Status.tsx 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4986628...446910c. Read the comment docs.

@miroslavstastny
Copy link
Member

Some icons do not support outline/filled and are not visible, some others ignore the variable:
image
I really like the changes here, once merged, I will update #364 to match the changes.

It would be great if @kuzhelov could review the changes as well.

<Label content="Default" />
</div>
<div style={{ marginBottom: '1.2rem' }}>
<Label content="Before" />
<Icon name="umbrella" xSpacing="before" size="big" />
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@kuzhelov kuzhelov left a comment

Choose a reason for hiding this comment

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

do like the approach taken - have left several minor comments, please, feel free to decide on whether they should be addressed 👍Please, just make CHANGELOG entry before merging these changes.

Also have made a not to myself in regards to styles prop of the icon with empty object value.

}
},
},
styles: {},
Copy link
Contributor

Choose a reason for hiding this comment

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

note to myself - if there are no icon-specific styles (like the ones that will be applied to call icon exclusively), this styles prop should be safe to delete from this object

@kuzhelov
Copy link
Contributor

kuzhelov commented Nov 8, 2018

@codepretty

Question: Are the icons examples too tied to Teams theme? In a default theme, what would the expectation be if there is no icon provider shown? Today, it fails silently by not showing anything which feels right to me, but wanted to get others opinions..

The Icon examples are indeed to tied to Teams theme now, but see this as a normal thing for now at least, and speaking of the last section on the Icon's docs page (where all the icons are shown) - this close tie is inevitable there. In either case, it seems that we are in a pretty good position to address this "close tie" problem for icons if necessary - as these changes don't make the problem any worse.

Speaking of the behavior in case if icon is absent in theme's collection - I would expect that there will be a warning/error message logged to the dev console, so this fact won't be unnoticed; speaking of rendering process - yes, absolutely agree that this fact shouldn't result in exceptions being thrown: whole components' tree should be just rendered without this missing icon.

@kohlikohl
Copy link
Collaborator

@codepretty There are a bunch of additional icons that we would need support for. Would they be added as part of this PR?

Icons needed

  • Like
  • send message
  • bookmark
  • trash
  • redo
  • pencil (edit)
  • mark as unread
  • translate
  • immersive reader
  • add participants
  • alert (triangle with exclamation mark)
  • add participant (add one participant)
  • remove participant
  • @ for at-mention
  • exclamation mark for important messages
  • add to calendar
  • member joined (control message in conversation)
  • member left (control message in conversation)

@codepretty
Copy link
Collaborator Author

@kohlikohl importing icons is a separate PR. It is almost ready, just want to get this checked in first.

@codepretty codepretty merged commit 7effe12 into master Nov 14, 2018
@codepretty codepretty deleted the feat/teams-icons-redlines branch November 14, 2018 20:34
@kuzhelov kuzhelov mentioned this pull request Nov 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀 ready for review redlines Update of the redlines for the mentioned component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants