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
Consider using dbc components to enable dbc.themes #235
Comments
@huong-li-nguyen
In some cases the Bootstrap theme is over-ridding the Vizro theme. Like here for example: In other cases, the Vizro style does not include some of the selectors that are included in the Bootstrap stylesheet. |
Hey @AnnMarieW - yes, you are absolutely right! It's not compatible with I think we need to solve several questions first - one is a general plan of how we want to simplify the process of providing other themes, which I need to discuss with @Joseph-Perkins and @antonymilne to see how it fits into our overall strategy/possible path forward. I would love to hear your thoughts about that as well when it comes to that point! @AnnMarieW - Is Thanks again for your valuable input! 🙏 |
When using the Dash Bootstrap Components library in a Dash app, it's necessary to add a Bootstrap stylesheet. The most common way is with an external stylesheet like this:
Check out this example app from the dbc.Accordion docs. Try running it with and without the stylesheet. I'm just concerned that people who are familiar with Dash, may think it's either necessary, (or acceptable) to include Bootstrap stylesheet with Vizro. import dash_bootstrap_components as dbc
from dash import Dash, html
#app = Dash(__name__,external_stylesheets=[dbc.themes.BOOTSTRAP])
# Example with no Bootstrap Stylesheet
app=Dash(__name__)
accordion = html.Div(
dbc.Accordion(
[
dbc.AccordionItem(
[
html.P("This is the content of the first section"),
dbc.Button("Click here"),
],
title="Item 1",
),
dbc.AccordionItem(
[
html.P("This is the content of the second section"),
dbc.Button("Don't click me!", color="danger"),
],
title="Item 2",
),
dbc.AccordionItem(
"This is the content of the third section",
title="Item 3",
),
],
)
)
app.layout=dbc.Container(accordion, fluid=True)
app.run(debug=True)
1. No stylesheet2. With Bootstrap stylesheetYou can see which stylesheet is used in the app like this:
Many people put this .css file in the assets folder so it's possible to work off-line, and so the app works if the cdn goes down for any reason. So far the main issue I've seen when using both Dash Mantine Components and Dash Bootstrap Components in the same app is the style of the components is different. |
What's the problem this feature will solve?
Following up on: #205 (comment)
Currently, the dashboard looks off if people try to add their dbc.themes as external stylesheets as our components are not only based on dbc components.
Available vizro stylesheets are currently accessible via
dashboard.theme
but the process for the user to add their own themes is not as straight-forward as dbc-themes. This issue opens several questions:Describe the solution you'd like
Alternative Solutions
Additional context
Code of Conduct
The text was updated successfully, but these errors were encountered: