-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: redesign labels #31575
feat: redesign labels #31575
Changes from all commits
5ae5475
9d7dd6a
269f120
4b811d5
6a46815
3755f16
1223ca5
913c25d
324e636
4f26653
db6b8b5
e960903
05bdba2
f53f183
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,23 +25,96 @@ export default { | |
|
||
export const ThemeColors = () => { | ||
const { colors } = supersetTheme; | ||
return Object.keys(colors).map(collection => ( | ||
|
||
// Define tones to be displayed in columns | ||
const tones = [ | ||
'dark2', | ||
'dark1', | ||
'base', | ||
'light1', | ||
'light2', | ||
'light3', | ||
'light4', | ||
'light5', | ||
]; | ||
const colorTypes = [ | ||
'primary', | ||
'secondary', | ||
'grayscale', | ||
'error', | ||
'warning', | ||
'alert', | ||
'success', | ||
'info', | ||
]; | ||
return ( | ||
<div> | ||
<h2>{collection}</h2> | ||
<table style={{ width: '300px' }}> | ||
{Object.keys(colors[collection]).map(k => { | ||
const hex = colors[collection][k]; | ||
return ( | ||
<tr> | ||
<td>{k}</td> | ||
<td> | ||
<code>{hex}</code> | ||
<h1>Theme Colors</h1> | ||
<table | ||
style={{ borderCollapse: 'collapse', width: '100%', textAlign: 'left' }} | ||
> | ||
<thead> | ||
<tr> | ||
<th style={{ border: '1px solid #ddd', padding: '8px' }}> | ||
Category | ||
</th> | ||
{tones.map(tone => ( | ||
<th | ||
key={tone} | ||
style={{ border: '1px solid #ddd', padding: '8px' }} | ||
> | ||
{tone} | ||
</th> | ||
))} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{colorTypes.map(category => ( | ||
<tr key={category}> | ||
<td style={{ border: '1px solid #ddd', padding: '8px' }}> | ||
<strong>{category}</strong> | ||
</td> | ||
<td style={{ width: '150px', backgroundColor: hex }} /> | ||
{tones.map(tone => { | ||
const color = colors[category][tone]; | ||
return ( | ||
<td | ||
key={tone} | ||
style={{ | ||
border: '1px solid #ddd', | ||
padding: '8px', | ||
backgroundColor: color || '#fff', | ||
}} | ||
> | ||
{color ? <code>{color}</code> : '-'} | ||
</td> | ||
); | ||
})} | ||
</tr> | ||
); | ||
})} | ||
))} | ||
</tbody> | ||
</table> | ||
<h3> | ||
text.label: <code>{colors.text.label}</code> | ||
</h3> | ||
<div style={{ color: `#${colors.text.label}` }}> | ||
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. Invalid Color Format in Text Label StylingTell me moreWhat is the issue?The code incorrectly prepends '#' to the color value from colors.text.label, which likely already includes the '#' prefix, resulting in an invalid color format. Why this mattersThis will cause the text to be rendered with an invalid color value, making it invisible or using the browser's default color instead of the intended theme color. Suggested changeRemove the '#' prefix: style={{ color: colors.text.label }} Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews. |
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim | ||
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea | ||
commodo consequat. | ||
</div> | ||
<h3> | ||
text.help: <code>{colors.text.help}</code> | ||
</h3> | ||
<div style={{ color: `#${colors.text.help}` }}> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim | ||
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea | ||
commodo consequat. | ||
</div> | ||
<h3>The supersetTheme object</h3> | ||
<code> | ||
<pre>{JSON.stringify(supersetTheme, null, 2)}</pre> | ||
</code> | ||
</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.
This change is improving the
Theme Colors
storybook as I kind of needed that to see throught his PR. Not directly related to the PR but helpful overall.