-
Notifications
You must be signed in to change notification settings - Fork 14k
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
chore: Migrate .less styles to Emotion #22474
Conversation
782ff29
to
5e932f5
Compare
3161f6a
to
1758863
Compare
/testenv up |
@kgabryje Ephemeral environment spinning up at http://54.202.20.183:8080. Credentials are |
Thank you for great feedback @michael-s-molina! I addressed all of your comments (including translating "Empty column") except for the one about using theme fonts in Ace Editor. We can do an investigation as a follow up to verify if the comment about buggy Fira font is still valid |
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.
LGTM. Thank you for all the hard work and for addressing the comments @kgabryje. I would also suggest that you get QA's approval before merging the PR. We could schedule a team review to go through the application to see if we spot any differences as an additional precaution.
CC @AnushaErrabelli for review |
LGTM. |
.ant-modal-body { | ||
overflow: auto; | ||
} |
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.
Seems like we might be able to get rid of this one, if I recall correctly.
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'll check!
@@ -449,7 +456,7 @@ const ResultSet = ({ | |||
<ButtonGroup> | |||
<Button | |||
buttonSize="small" | |||
className="m-r-5" |
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.
If this PR doesn't do it, we can probably do a sweep to get rid of these weird little utility classes soon.
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.
Yup, out of scope of this PR
@@ -327,6 +313,10 @@ table.table-no-hover tr:hover { | |||
margin-bottom: 10px; | |||
} | |||
|
|||
.m-l-2 { |
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 probably got yanked in from another file, and i'm lost in the weeds, but just making sure we're not adding more of these utility classes if we don't need to ;)
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, the "global" stylesheets were out of scope of this PR and that .m-l-2
class looked like it belonged here.
|
||
/* A row within a column has inset hover menu */ | ||
.dragdroppable-column .dragdroppable-row .hover-menu--left { | ||
left: ${theme.gridUnit * -3}px; |
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.
Is this what we'd want if we ever changed the scale of the grid unit? If it just needs to be 1px forever and always, so be it ;)
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.
Good point 🤔 We should do a sweep through the styles and verify if some values should be hardcoded rather than be dependent on theme
height: 100%; | ||
top: 0; | ||
left: 0; | ||
z-index: 1; |
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.
At some point, we should bring back a z-index "registry" and centralize all these things values as vars.
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.
👍
position: relative; | ||
|
||
&.dragdroppable--dragging { | ||
opacity: 0.2; |
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.
The theme contains opacity stops we should leverage wherever it makes sense. It includes 10% and 35% stops at the moment, so maybe we should try one of those here in a separate PR? There are probably random opacities all over we could audit for.
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.
Ok, I'll see which fits better 👍
} | ||
|
||
&.dragdroppable-column .resizable-container span div { | ||
z-index: 10; |
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.
Again, we should have a z-index registry, so we can think of all of Superset as layers in a consolidated way, do calculations like theme.layers.navigation + 1
.
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.
👍
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
border: 2px solid ${theme.colors.primary.base}; |
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 think this is the first 2px border I've seen in all this. Might be worth checking for consistency.
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.
position: absolute; | ||
flex-wrap: nowrap; | ||
left: 1px; | ||
top: -42px; |
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.
Not sure if these should be in gridUnits, or if it's -42 for a specific reason.
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.
Yes it should be in gridUnits. It's related to component's height (40px or 10gridUnits)
@@ -18,6 +18,39 @@ | |||
*/ | |||
import { css, SupersetTheme } from '@superset-ui/core'; | |||
|
|||
export const headerStyles = (theme: SupersetTheme) => css` |
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.
Hmm... I wonder if these are worth moving into (or along side of) the theme itself for global re-use
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.
Previously it targeted only Dashboard, so I moved it here in order to reduce the impact and chances of regressions. You're right though that we might want to make it global
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 is awesome! I left a few nits/questions/follow-ups for future sweeping, but in general, this seems fantastic! Should we reset the baseline on visual regression tests and make sure this doesn't trigger any alarm bells?
@kgabryje any reason not to merge this before the inevitable conflicts arise? |
Good call @rusackas! I'll do a sweep through your comments in a followup PR |
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
This PR migrates all .less files that target Dashboard, Explore and SqlLab. Generic stylesheets (for example with antd overrides or global LESS variables) are out of scope
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Test all flows related to Dashboard and SqlLab. Compare with current master - there shouldn't be any meaningful changes, except for small spacing changes here and there (so that the spacings use grid unit from Superset's theme).
Explore shouldn't really be affected by this PR - I removed
explore/main.less
stylesheet, but it seems that it wasn't even used at all. However, check the Explore page just to be safe.ADDITIONAL INFORMATION