-
Notifications
You must be signed in to change notification settings - Fork 55
feat(Icon): Teams theme add static outline and filled classes to SVG icons #834
Conversation
|
||
describe('Teams Theme Icon', () => { | ||
function testIcon(icon) { | ||
const iconFunc: any = (icon as SvgIconSpecWithStyles).icon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not cover all possible Icon flavors, but works for all Teams theme icons.
Instead of implementing universal test now, let it fail and iterate.
Codecov Report
@@ Coverage Diff @@
## master #834 +/- ##
=======================================
Coverage 93.54% 93.54%
=======================================
Files 21 21
Lines 728 728
Branches 69 73 +4
=======================================
Hits 681 681
Misses 47 47 Continue to review full report at Codecov.
|
packages/react/src/themes/teams/components/Icon/svg/ProcessedIcons/icons-accept.tsx
Outdated
Show resolved
Hide resolved
packages/react/test/specs/themes/teams/components/Icon/Icon-test.ts
Outdated
Show resolved
Hide resolved
|
||
export default { | ||
icon: ({ classes }) => ( | ||
<svg role="presentation" focusable="false" viewBox="8 8 16 16" className={classes.svg}> | ||
<g> | ||
<path | ||
className={classes.outlinePart} | ||
className={cx(teamsIconSlotClassNames.outline, classes.outlinePart)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't like the fact that this class name data is repeated for every icon while, in fact, it provides the same information as classes.outlinePart
. We might think about some way to provide classes
via styles, via dedicated prop - so that this repetition will be avoided.
const iconStyles = ({ ... }) => ({
root: ....,
outlinePart: {
...
classes: ['outline']
}
})
Note that this will be quite safe move (as it is quite easy to filter out this prop before Fela transformations), as well as we will still preserve full control of this aspect being provided to the client's hands (so it will be up to client to decide on class names policy, extend this set, etc)
Closes #716.
teamsIconSlotClassNames.outline
andfilled
to all SVG icons in Teams theme which have outline and/or filled paths,teamsIconSlotClassNames
instead of hardcoded class names in theme styles,