-
Notifications
You must be signed in to change notification settings - Fork 894
feat: add light theme #11266
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
Merged
Merged
feat: add light theme #11266
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0092d93
add light theme
aslilac ef3c623
🧹
aslilac d6717f3
Merge branch 'main' into light-theme
aslilac 6833e6b
🧹
aslilac d86c20e
fix the editor
aslilac 3eeb8d0
tweak story parameters
aslilac 405d0f3
oh boy
aslilac d407ccf
✨
aslilac e81f23a
add some ignore attributes for chromatic
aslilac c22a879
next round
aslilac 058991f
bunch of polish
aslilac 6491117
add helm dependency update
matifali 4cc558b
mark light as beta
aslilac 0b4dc8d
fix some more issues
aslilac 6314341
test
aslilac c07e571
Merge branch 'main' into light-theme
aslilac ee81c62
ok
aslilac 4815604
whoops
aslilac c68faf0
revert `ExternalIcon` stuff
aslilac 00c9f74
fix pagination
aslilac 7121d45
ah
aslilac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
import { type FC } from "react"; | ||
import { useTheme } from "@emotion/react"; | ||
import { type Interpolation, type Theme } from "@emotion/react"; | ||
import { MONOSPACE_FONT_FAMILY } from "theme/constants"; | ||
import { CopyButton } from "../CopyButton/CopyButton"; | ||
|
||
export interface CodeExampleProps { | ||
code: string; | ||
password?: boolean; | ||
secret?: boolean; | ||
className?: string; | ||
} | ||
|
||
/** | ||
* Component to show single-line code examples, with a copy button | ||
*/ | ||
export const CodeExample: FC<CodeExampleProps> = (props) => { | ||
const { code, password, className } = props; | ||
const theme = useTheme(); | ||
|
||
export const CodeExample: FC<CodeExampleProps> = ({ | ||
code, | ||
secret, | ||
className, | ||
}) => { | ||
return ( | ||
<div | ||
css={{ | ||
display: "flex", | ||
flexDirection: "row", | ||
alignItems: "center", | ||
background: "rgb(0 0 0 / 30%)", | ||
color: theme.palette.primary.contrastText, | ||
fontFamily: MONOSPACE_FONT_FAMILY, | ||
fontSize: 14, | ||
borderRadius: 8, | ||
padding: 8, | ||
lineHeight: "150%", | ||
border: `1px solid ${theme.palette.divider}`, | ||
}} | ||
className={className} | ||
> | ||
<code | ||
css={{ | ||
padding: "0 8px", | ||
width: "100%", | ||
display: "flex", | ||
alignItems: "center", | ||
wordBreak: "break-all", | ||
"-webkit-text-security": password ? "disc" : undefined, | ||
}} | ||
> | ||
{code} | ||
</code> | ||
<div css={styles.container} className={className}> | ||
<code css={[styles.code, secret && styles.secret]}>{code}</code> | ||
<CopyButton text={code} /> | ||
</div> | ||
); | ||
}; | ||
|
||
const styles = { | ||
container: (theme) => ({ | ||
display: "flex", | ||
flexDirection: "row", | ||
alignItems: "center", | ||
color: theme.experimental.l1.text, | ||
fontFamily: MONOSPACE_FONT_FAMILY, | ||
fontSize: 14, | ||
borderRadius: 8, | ||
padding: 8, | ||
lineHeight: "150%", | ||
border: `1px solid ${theme.experimental.l1.outline}`, | ||
}), | ||
|
||
code: { | ||
padding: "0 8px", | ||
flexGrow: 1, | ||
wordBreak: "break-all", | ||
}, | ||
|
||
secret: { | ||
"-webkit-text-security": "disc", // also supported by firefox | ||
}, | ||
} satisfies Record<string, Interpolation<Theme>>; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.