-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1337 +/- ##
==========================================
+ Coverage 72.2% 72.39% +0.19%
==========================================
Files 769 770 +1
Lines 5777 5749 -28
Branches 1688 1680 -8
==========================================
- Hits 4171 4162 -9
+ Misses 1600 1581 -19
Partials 6 6
Continue to review full report at Codecov.
|
@@ -20,7 +20,7 @@ class App extends React.Component<any, ThemeContextData> { | |||
<ThemeContext.Provider value={this.state}> | |||
<Provider | |||
as={React.Fragment} | |||
theme={mergeThemes(themes[themeName], { | |||
theme={mergeThemes(themes.fontAwesome, themes[themeName], { |
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.
We're using FA on docs, but we don't to have this theme in any other even in base
@@ -540,6 +540,7 @@ class ComponentExample extends React.Component<ComponentExampleProps, ComponentE | |||
render={this.renderElement} | |||
renderHtml={showCode} | |||
resolver={importResolver} | |||
themeName={themeName} |
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 will allow us to access themeName
in example components
@@ -18,7 +18,7 @@ const AvatarExampleImageCustomizationShorthand = () => ( | |||
// This example does not react to the avatar size variable | |||
// and otherwise produces bad results when border is applied compared to "normal" image | |||
<Icon | |||
name="user" | |||
name="lock" |
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.
Teams theme doesn't have this icon and font icons will not be supported inside of it
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.
I am a bit confuse here. We are changing only this icon because Teams' theme doesn't support font icons? What about all other examples like: 'chess rook', 'book' etc. Are we planning to move all examples for now to reflect the Teams' theme icon names?
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.
We are changing only this icon because Teams' theme doesn't support font icons?
This slot in attachment requires an additional styling for font icons that is not present, so yes.
styles: { | ||
...(isSvgIcon ? styles.svgRoot : styles.fontRoot), | ||
...styles.root, | ||
}, |
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.
I have to use styles
to avoid collisions in generated classes names... The other option is to use generateCSS()
directly, but I will need to get renderer
from somewhere
color: v.disabledColor, | ||
}), | ||
}), | ||
fontRoot: ({ props: p, variables: v, theme: t }): ICSSInJSStyle => { |
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.
Now we have separate roots for SVG and font icons that allows to apply overrides without conditions
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.
I like that we have two things separated 👍
mediumSize: string | ||
largeSize: string | ||
largerSize: string | ||
largestSize: string |
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.
Size values where moved to variables
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.
Not sure that these size values are general enough for base theme...
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.
Base theme should support size
prop properly and we should avoid nesting in variables. Do you have better proposal? 🐱
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.
I agree that we should have variables and use this, I was saying about the size values (which now reflect the Teams theme) If you think these values are general and should be defined as this, then I am okay
…rdust-ui/react into feat/fa-theme # Conflicts: # CHANGELOG.md
export default { | ||
icons, | ||
componentStyles, | ||
} as ThemeInput |
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.
Can we not expose this theme to the users? Everything is breaking if I choose this one on the Icon's docs. I don't see any benefit for the clients to explore this theme..
|
||
const iconStyles: ComponentSlotStylesInput<IconProps, IconVariables> = { | ||
fontRoot: (): ICSSInJSStyle => ({ | ||
fontWeight: 900, // required for the fontAwesome to render |
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.
It's great that the only required override is actually related to the font awesome icons. I would really like the same thing to be applicable for svgs :)
@@ -64,6 +64,7 @@ const radioStyles: ComponentSlotStylesInput< | |||
// overrides from icon styles | |||
backgroundColor: 'transparent', | |||
boxShadow: 'none', | |||
boxSizing: 'border-box', |
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.
Shouldn't this be applied by default?? We are using only svg icons and they already have border-box
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.
Based on offline discussion we decided to add a new icon and use it.
return { | ||
display: 'inline-block', | ||
backgroundColor: v.backgroundColor, | ||
boxSizing: 'border-box', |
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.
No need for specifying boxSizing: 'border-box'. Teams theme users only svg icons, and there is no prev definition of 'content-box' (it is for font icons in base theme, not svg)
…rdust-ui/react into feat/fa-theme # Conflicts: # CHANGELOG.md
BREAKING CHANGES
FontAwesome icons is not a part of Teams theme more consider to use SVG icons.
FontAwesome styles were extracted to a separate theme which can be merged with the base for example.
Adds separate roots for font and SVG icons, so styles can be configured independently now without conditions in styles: