Replies: 11 comments
-
Hi @sssaha Bootstrap has a lot of styling applied globally that interferes with the DMC styles. Starting in dmc 0.14 it looks like the Bootstrap stylesheets are not compatible with all DMC components. You might be able to inspect the browser and see what's causing the issue and over-ride the CSS. |
Beta Was this translation helpful? Give feedback.
-
Add a custom.css in your assets folder as this:
This reverts the pesky alterations from bootstrap on the actual base component. |
Beta Was this translation helpful? Give feedback.
-
Thanks @BSd3v - the solution worked. I removed Bootstrap components as much as possible from my current design - but somethings are hard to remove |
Beta Was this translation helpful? Give feedback.
-
@sssaha |
Beta Was this translation helpful? Give feedback.
-
I had some stupid ones
dmc.GridCol(span=12, style={'padding-bottom': "0px"}, children=html.Div(className='py-3 d-flex align-items-center', children=[
html.Hr(className="flex-grow-1"), html.Div(children=dmc.Badge('Results', radius='xl', size='xl', gradient={"from": "indigo", "to": "cyan"}, variant="gradient", )),
html.Hr(className="flex-grow-1"),
dmc.Tooltip(
dmc.ActionIcon(DashIconify(icon="material-symbols:history", width=20), style={'margin-left': "10px"}, size='lg', color='orange', id=f'{cls.selected_test}_show_decision_history'),
label="Show Decision History",
withArrow=False,
position='left', zIndex=5000
),
], )), |
Beta Was this translation helpful? Give feedback.
-
None of this is "stupid" It's not easy to switch when you are fluent in Bootstrap. It would be really helpful if you opened a topic called "Migrating from Bootstrap" in Discussions. We can continue working through this and it would be great to start a collection of examples! https://github.com/snehilvj/dash-mantine-components/discussions Dash AG Grid should work, and it's a great choice, especially if you want more features later, and you can also use a dataframe to populate the grid. Can you include some sample data? Not sure what you are trying to do with the code snippet, but including an image would be helpful too. |
Beta Was this translation helpful? Give feedback.
-
And also - I was not migrating - I have been using DMC for quite a long time - but sometimes mix Bootstrap if required. I have created a version of DMC that took your suggestions so I could take Miliseconds in DMC DATE TIME PICKER. |
Beta Was this translation helpful? Give feedback.
-
There was not really any Bootstrap specific things in your example - besides some Bootstrap class names. There are similar things in DMC using the style props, or you can create your own classnames that do the same as the Bootstrap class names, then you don't need the Bootstrap stylesheet. You can also use dmc.Divider which requires less CSS to implement. Try this: badge = dmc.Badge('Results', radius='xl', size='xl', gradient={"from": "indigo", "to": "cyan"}, variant="gradient", )
actionicon = dmc.Tooltip(
dmc.ActionIcon(DashIconify(icon="material-symbols:history", width=20), style={'margin-left': "10px"}, size='lg', color='orange', id='show_decision_history'),
label="Show Decision History",
withArrow=False,
position='left', zIndex=5000
)
component = dmc.Group([
dmc.Divider(label=badge, labelPosition="center", style={"flexGrow": 1}),
actionicon
], py="lg")
|
Beta Was this translation helpful? Give feedback.
-
Where can I learn / know more about this style parameters? I do not remember seeing a parameter called flexGrow .. |
Beta Was this translation helpful? Give feedback.
-
It's just plain CSS: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow The
This prop applies that CSS to all the children in the |
Beta Was this translation helpful? Give feedback.
-
See screenshot of the legend component when DBC THEMES are imported as part of the external stylesheet. The issue goes away if DBC BOOTSTRAP THEME is not added in the external stylesheet
Beta Was this translation helpful? Give feedback.
All reactions