-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(jss): Updated to use JSS and migrate styles from patternfly's react styles #60
Conversation
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These global variables will not exist in v6 - they are replaced with things that start with --pf-t-
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.
done.
resize: 'none' | ||
}, | ||
'.xterm .composition-view': { | ||
background: '#000', |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #62
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.
@@ -135,9 +150,9 @@ export const AccessConsoles: React.FunctionComponent<AccessConsolesProps> = ({ | |||
} | |||
}); | |||
return ( | |||
<div className={css(styles.console)}> | |||
<div className={clsx(styles.console)}> |
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.
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<div className={clsx(styles.consoleActionsSerial)}> | |
<div className={styles.consoleActionsSerial}> |
@@ -130,6 +134,6 @@ export const XTerm: React.FunctionComponent<XTermProps> = ({ | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} />; |
@@ -235,7 +248,7 @@ export const VncConsole: React.FunctionComponent<VncConsoleProps> = ({ | |||
return ( | |||
<> | |||
{rightContent} | |||
<div className={css(styles.consoleVnc)}> | |||
<div className={clsx(styles.consoleVnc)}> |
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.
<div className={clsx(styles.consoleVnc)}> | |
<div className={styles.consoleVnc}> |
@@ -34,7 +48,7 @@ export const VncActions: React.FunctionComponent<VncActionProps> = ({ | |||
setIsOpen(false); | |||
}; | |||
const toolbar = ( | |||
<div className={css(styles.consoleActionsVnc)}> | |||
<div className={clsx(styles.consoleActionsVnc)}> |
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.
<div className={clsx(styles.consoleActionsVnc)}> | |
<div className={styles.consoleActionsVnc}> |
@@ -130,7 +134,7 @@ const SerialConsoleBase: React.FunctionComponent<SerialConsoleProps> = ({ | |||
textReset={textReset} | |||
/> | |||
)} | |||
<div className={css(styles.consoleSerial)}>{terminal}</div> | |||
<div className={clsx(styles.consoleSerial)}>{terminal}</div> |
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.
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<div className={clsx(styles.consoleDesktopViewer)}> | |
<div className={styles.consoleDesktopViewer}> |
{React.Children.toArray(children).length > 1 && ( | ||
<div className={css(styles.consoleActions)}> | ||
<div className={clsx(styles.consoleActions)}> |
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.
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can colors in this file be updated to tokens rather than hardcoded hex values?
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.
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.