First steps of bootstrap replacement#19946
Conversation
improve highlight visibility
|
I love the direction this is taking, thank you for working on it. I know this is probably what you are already doing, but we should definitely take these components incrementally -- following up on the link component, etc. separately and focus just on button (and I guess tooltip) here. My one concern is using raw color vars directly in each component. I think we might want to go ahead and take the plunge to use semantic design tokens that then use the color system. This is future-proofing easier theme support and changes, more clarity in naming (i.e., you don't pick a shade of grey in fancy-new-component-x, you just use i.e. -- That then gets used in the component as: ? One more thought (not really a concern, but something to think about as you build more of these) - we may want to move some of the more repetitive boilerplate blocks to use mixins, for consistency, reuse, and just easier reading. (Again, THANK YOU for working on this :) ) |
|
Thank you for having a look at this and your feedback!
Yes, I agree, and it is on what I plan to do. I also plan to have the PRs which replace this component separately, save from some example use-cases, so it makes the implementation easier to review. This PR only includes 3 components, because the button component heavily depends on the other two components included.
I plan on doing this, if I sport overlap in future components. However, I will try to prioritize nesting components over styles duplicated via mixins. Regarding raw colors vs semantic colors: I have though a lot about semantic colors vs raw color tokens before deciding on raw color tokens. My reasoning is as follows:
So in total I think that the raw color tokens actually scale better, and offer a better developer experience, despite not seeming like they do on the surface. There may be some special component for which we still want separate definitions, like the masthead, but I do not think that this should be generally done for all types of components. |
|
Thanks for your thoughtful and detailed response on the color system approach -- I appreciate how much consideration you've put into this. The points about maintaining visual distinctiveness between components and the challenges of consistent semantic abstraction are well-taken, and it's easy to acknowledge that raw color tokens provide more flexibility and direct visual mapping when implementing new components, but, I do think there might be value in a lightweight hybrid approach as the system evolves. Maybe as this goes we can identify a small set of heavily reused and stable concepts could be pulled out to address future maintenance without creating the rigidity you're concerned about. In any case, I'm comfortable with moving forward with the raw color token approach for now. We can always iterate on this as the component library grows and patterns emerge. The most important thing is making progress on the Bootstrap replacement, and your implementation looks excellent. Looking forward to seeing how this evolves, and thanks again for your work on this! |
3b019c7 to
282ec87
Compare
|
This PR was merged without a "kind/" label, please correct. |
Drops the @import of @/style/scss/theme/blue.scss and switches to the --color-* tokens from custom_theme_variables.scss (PR galaxyproject#19946, Laila Los): --color-blue-600 for info, --color-orange-600/200 for warning, --color-green-600/200 for success, --color-red-600/200 for danger, and --color-grey-100 for neutral background. GTip was the only G-component with an explicit theme SCSS import, so removing it cleans up the last bit of mandatory theme coupling in BaseComponents. The SCSS scale-color() calls for warning/success/danger backgrounds map to the 200-shade of each hue, which is the closest pre-defined match and avoids the partial-transparency pattern the color system intentionally moved away from. Prep work for the @galaxyproject/galaxy-ui workspace package: the package can't depend on Galaxy's SCSS theme, so it consumes CSS custom properties injected by the app at :root.
This PR is mostly to gather feedback on the discussed bootstrap replacement, as it will heavily shape on how the replacement will look and work moving forward. It includes a base implementation of the button component, which is our most heavily used component from the bootstrap vue library, to illustrate the direction I plan on taking this refactor.
The look of the button component is nearly identical, and the primary goal here to collect feedback on the code structure and direction.
My design goal with this refactor is not achieving a 100% drop in replacement, but still have the components easy to replace while adjusting their interfaces to our use-cases.
Tooltips
This PR also includes a re-implementation of the bootstrap vue tooltip, which is fully accessible. It can be activated and dismissed via keyboard and works on disabled components.
Color system
The color system is inspired by tailwind. Each color has a pre-defined set of handpicked gradients, to ensure sufficient contrast and color-uniformity. Additionally partially transparent colors have been removed, as they further reduce contrast, and lead to new, non-palettized colors. Each color has a gradient from 100, lightest, to 900, darkest. example usage:
var(--color-blue-500).Spacing
Spacing also follows tailwinds example. Instead of defining a arbitrary set of space sizes, all sizes are a multiple of a base size. example usage:
var(--spacing-4)is 4 times the base spacing.Next steps
The next step for the replacement will be replacing all uses of plain (non-grouped) boostrap buttons with this component, and adding additional features required to do so. Mainly an icon-only variant of the button is still missing.
After that further components will be converted, starting with button groups.
Additionally I would like to add a GLink component, as we heavily make use of custom, button-like links.
How to test the changes?
(Select all options that apply)
License