feat(jss): Updated to use JSS and migrate styles from patternfly's react styles#60
feat(jss): Updated to use JSS and migrate styles from patternfly's react styles#60dlabaj merged 2 commits intopatternfly:v6from
Conversation
nicolethoen
left a comment
There was a problem hiding this comment.
I wonder how many of these CSS overrides we could actually remove now on V6. if not removed, many will need to be updated in this PR or a follow up
| display: 'grid', | ||
| gridTemplateAreas: | ||
| `'actions-main actions-extra' + 'main main'`, | ||
| rowGap: 'var(--pf-v6-global--spacer--md)' |
There was a problem hiding this comment.
These global variables will not exist in v6 - they are replaced with things that start with --pf-t-
| resize: 'none' | ||
| }, | ||
| '.xterm .composition-view': { | ||
| background: '#000', |
There was a problem hiding this comment.
There are tokens that can be used in lieu of hard coded color values
| }, | ||
| consoleActionsVnc: { | ||
| gridArea: 'actions-extra', | ||
| display: 'flex', |
There was a problem hiding this comment.
I wonder if we can use a flex layout here instead of all these flex related css overrides
There was a problem hiding this comment.
Makes sense we should add this. Created an issue for this so that we can add this without slowing down the release as this will require some rework (#62).
| }, | ||
| consoleActionsVnc: { | ||
| gridArea: 'actions-extra', | ||
| display: 'flex', |
There was a problem hiding this comment.
I wonder if we can use a flex layout here instead of all these flex related css overrides
| }); | ||
| return ( | ||
| <div className={css(styles.console)}> | ||
| <div className={clsx(styles.console)}> |
There was a problem hiding this comment.
| <div className={clsx(styles.console)}> | |
| <div className={styles.console}> |
I think there is no need to use clsx in such cases
| }: SerialConsoleActionsProps) => { | ||
| const styles = useStyles(); | ||
| return ( | ||
| <div className={clsx(styles.consoleActionsSerial)}> |
There was a problem hiding this comment.
| <div className={clsx(styles.consoleActionsSerial)}> | |
| <div className={styles.consoleActionsSerial}> |
| // ensure react never reuses this div by keying it with the terminal widget | ||
| // Workaround for xtermjs/xterm.js#3172 | ||
| return <div ref={ref} className="pf-v6-c-console__xterm" role="list" onFocus={onFocusIn} onBlur={onFocusOut} />; | ||
| return <div ref={ref} className={clsx(styles['.xterm'])} role="list" onFocus={onFocusIn} onBlur={onFocusOut} />; |
There was a problem hiding this comment.
| return <div ref={ref} className={clsx(styles['.xterm'])} role="list" onFocus={onFocusIn} onBlur={onFocusOut} />; | |
| return <div ref={ref} className={styles['.xterm']} role="list" onFocus={onFocusIn} onBlur={onFocusOut} />; |
| <> | ||
| {rightContent} | ||
| <div className={css(styles.consoleVnc)}> | ||
| <div className={clsx(styles.consoleVnc)}> |
There was a problem hiding this comment.
| <div className={clsx(styles.consoleVnc)}> | |
| <div className={styles.consoleVnc}> |
| }; | ||
| const toolbar = ( | ||
| <div className={css(styles.consoleActionsVnc)}> | ||
| <div className={clsx(styles.consoleActionsVnc)}> |
There was a problem hiding this comment.
| <div className={clsx(styles.consoleActionsVnc)}> | |
| <div className={styles.consoleActionsVnc}> |
| /> | ||
| )} | ||
| <div className={css(styles.consoleSerial)}>{terminal}</div> | ||
| <div className={clsx(styles.consoleSerial)}>{terminal}</div> |
There was a problem hiding this comment.
| <div className={clsx(styles.consoleSerial)}>{terminal}</div> | |
| <div className={styles.consoleSerial}>{terminal}</div> |
| }: DesktopViewerProps) => { | ||
| const styles = useStyles(); | ||
| return ( | ||
| <div className={clsx(styles.consoleDesktopViewer)}> |
There was a problem hiding this comment.
| <div className={clsx(styles.consoleDesktopViewer)}> | |
| <div className={styles.consoleDesktopViewer}> |
| <div className={clsx(styles.console)}> | ||
| {React.Children.toArray(children).length > 1 && ( | ||
| <div className={css(styles.consoleActions)}> | ||
| <div className={clsx(styles.consoleActions)}> |
There was a problem hiding this comment.
| <div className={clsx(styles.consoleActions)}> | |
| <div className={styles.consoleActions}> |
…jss. Also added corepack support for legacy yarn.
packages/module/src/css/xterm.css
Outdated
|
|
||
| .xterm .composition-view { | ||
| /* TODO: Composition position got messed up somewhere */ | ||
| background: #000; |
There was a problem hiding this comment.
Can colors in this file be updated to tokens rather than hardcoded hex values?
There was a problem hiding this comment.
Got it. Thanks nicole.
|
🎉 This PR is included in version 6.0.0-alpha.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 6.0.0-prerelease.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |




Updated code to use JSS and remove the need to import the styles from react styles. A follow up PR will be sent out to remove the console styles from patternfly repo. This resolves issue #36 .
Note there is also support for corepack users added to this PR.
Click here to see documentation preview.