-
Notifications
You must be signed in to change notification settings - Fork 319
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
Updated Palette Generation #3481
Changes from 10 commits
f03e6e3
849603a
8421bf8
a909f04
9a829f2
6c9b511
6251abf
2068be9
b13905b
733438b
ad8c34a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These VRT screenshots are really useful. Is the background color of secondary button changing due to palette generation or a separate change in Odyssey? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like it's a change in Odyssey 1.5.0 https://github.com/okta/odyssey/blob/main/CHANGELOG.md#150-2023-10-27 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,20 +10,24 @@ | |
* See the License for the specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
import { Theme } from '@mui/material'; | ||
import { useOdysseyDesignTokens } from '@okta/odyssey-react-mui'; | ||
import { AppsIcon } from '@okta/odyssey-react-mui/icons'; | ||
import { FunctionComponent, h } from 'preact'; | ||
|
||
import { loc } from '../../util'; | ||
|
||
export const AppIcon: FunctionComponent = () => ( | ||
<AppsIcon | ||
sx={(theme: Theme) => ({ | ||
color: theme.palette.primary.main, | ||
width: '16px', | ||
height: '16px', | ||
})} | ||
titleAccess={loc('icon.title.application', 'login')} | ||
aria-hidden | ||
/> | ||
); | ||
export const AppIcon: FunctionComponent = () => { | ||
const Tokens = useOdysseyDesignTokens(); | ||
|
||
return ( | ||
<AppsIcon | ||
sx={{ | ||
color: Tokens.PalettePrimaryMain, | ||
width: '16px', | ||
height: '16px', | ||
}} | ||
titleAccess={loc('icon.title.application', 'login')} | ||
aria-hidden | ||
/> | ||
); | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated custom icons that Denys added to use token overrides instead of |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,36 +13,40 @@ | |||||
import { | ||||||
GlobalStyles as MuiGlobalStyles, | ||||||
GlobalStylesProps, | ||||||
Theme, | ||||||
} from '@mui/material'; | ||||||
import { DesignTokens, useOdysseyDesignTokens } from '@okta/odyssey-react-mui'; | ||||||
import { FunctionComponent, h } from 'preact'; | ||||||
|
||||||
// TODO we could scope these to just widget container | ||||||
const svgStyles = (theme: Theme): GlobalStylesProps['styles'] => ({ | ||||||
const svgStyles = (Tokens: DesignTokens): GlobalStylesProps['styles'] => ({ | ||||||
'.siwFillPrimary': { | ||||||
fill: theme.palette.primary.main, | ||||||
fill: Tokens.PalettePrimaryMain, | ||||||
}, | ||||||
'.siwFillPrimaryDark': { | ||||||
fill: theme.palette.primary.dark, | ||||||
fill: Tokens.PalettePrimaryDark, | ||||||
}, | ||||||
'.siwFillSecondary': { | ||||||
fill: theme.palette.primary.light, | ||||||
fill: Tokens.PalettePrimaryLight, | ||||||
}, | ||||||
'.siwFillBg': { | ||||||
fill: theme.palette.grey[50], | ||||||
fill: Tokens.HueNeutral50, | ||||||
}, | ||||||
'.siwIconFillPrimaryDark': { | ||||||
fill: theme.palette.primary.dark, | ||||||
fill: Tokens.PalettePrimaryDark, | ||||||
}, | ||||||
'.siwIconFillSecondary': { | ||||||
fill: theme.palette.primary.light, | ||||||
fill: Tokens.PalettePrimaryLight, | ||||||
}, | ||||||
}); | ||||||
|
||||||
const GlobalStyles: FunctionComponent = () => ( | ||||||
<MuiGlobalStyles | ||||||
styles={(theme) => svgStyles(theme)} | ||||||
/> | ||||||
); | ||||||
const GlobalStyles: FunctionComponent = () => { | ||||||
const Tokens = useOdysseyDesignTokens(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: capitalization?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been using capital T for all uses of The capital T feels like it signals to the dev that these tokens are from ultimately from an import rather than something like a prop, but if this violates some syntax I don't mind switching all of the naming to use lowercase T There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope not a blocker. Just pointing it out because TitleCase is usually reserved for classes, types, interface, and enums(?), i.e., wanted to prevent ambiguity or confusion. |
||||||
|
||||||
return ( | ||||||
<MuiGlobalStyles | ||||||
styles={svgStyles(Tokens)} | ||||||
/> | ||||||
); | ||||||
}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See other comment about moving all uses of |
||||||
|
||||||
export default GlobalStyles; |
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.
You're intentionally pinning to the exact semver?
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.
Yeah I decided to pin exactly because even though Odyssey promised no breaking changes they have still been having some breaking changes. For example, the
OdysseyProvider
API was broken for a few versions and only just got fixed at this1.9.1
update