Open curq opened 1 year ago
- Instead of custom style .visTablecomponenttitle for centering text, use already existing OUI utility class oui-textCenter.
agree 💯
- Replace div containers with OUI flex components. It will also allow us to get rid of the .visTablegroupInColumns custom styling, because the OuiFlexGroup and OuiFlexItem do support both flex-direction and align-items. Current solution uses classnames to dynamically change the direction by applying .visTablegroupInColumns class to .visTable div container.
agree - can you create an issue for this change? An additional enhancement I'd love to see here is to add an additional option to wrap items, either by column or row. I'll open a separate issue for it, because it will be easier to do once it's refactored to use OuiFlex* components.
Leaving open for now until we complete #4255 and see what additional recommendations we may need.
Audit for https://github.com/opensearch-project/OpenSearch-Dashboards/issues/4099
In this plugin there is only one
.scss
file with only 4 css classes. https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/vis_type_table/public/components/table_vis_app.scss#L1-L29Conclusion
After looking through the plugin files, it seems like overall it is mostly using OUI with almost no native html. The only exceptions are the div containers for that use
visTable__group
andvisTable
custom styles. There are other usage of native html, but they are expected ( e.g. h3 in EuiTitle ).Also, the
flex: x y z
style is used in both containers. Currently OUI flex component do not supportflex-shrink
andflex-basis
. The same observations were made in other OUI audits. (https://github.com/opensearch-project/OpenSearch-Dashboards/issues/4122, https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3966). The issue for this was already made https://github.com/opensearch-project/oui/issues/776.Suggestions.
.visTable__component__title
for centering text, use already existing OUI utility classoui-textCenter
.div
containers with OUI flex components. It will also allow us to get rid of the.visTable__groupInColumns
custom styling, because theOuiFlexGroup
andOuiFlexItem
do support bothflex-direction
andalign-items
. Current solution uses classnames to dynamically change the direction by applying.visTable__groupInColumns
class to.visTable
div
container.