Feature/accept all colours#506
Merged
tcbegley merged 25 commits intodbc-team:masterfrom Jan 19, 2021
Merged
Conversation
Contributor
Author
|
Added some tests. |
tcbegley
reviewed
Jan 12, 2021
Collaborator
tcbegley
left a comment
There was a problem hiding this comment.
This is looking good. A few comments:
- Can we kill the
package-lock.jsonfile? The diff is unusually large (were you using Yarn?) and I normally wait until making a release to update it in any case to minimise noise in the commit history. - The fill colour on hover with
dbc.Button(..., outline=True)doesn't get updated, it stays as secondary (default). This is probably hard to fix because you can't set hover styles inline. - Related to last point, should we perhaps steer people towards default colours in
Button? It's not just the outline style that suffers, but also the hover effects for regular buttons get destroyed by the override here. I basically am unsure we should make it easier for people to make their app look worse 😆
Anyway, other than that it's all looking pretty good! Here's the app i was testing with for reference. Note that I chose the colours randomly for testing haha.
import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = html.Div(
[
dbc.NavbarSimple(brand="Navbar", color="red"),
dbc.Navbar("Hello", color="blue"),
dbc.Container(
[
dbc.Alert("Hello", color="chartreuse"),
dbc.Button("Hi", color="rebeccapurple"),
dbc.Button("There", outline=True, color="cyan"),
dbc.Badge("Badge", color="magenta"),
dbc.Label("Testing", color="orange"),
dbc.Progress(
color="chocolate", value=50, striped=True, animated=True
),
dbc.Spinner(color="darkviolet"),
dbc.Card("This is a card", body=True, color="deepskyblue"),
dbc.DropdownMenu(
[dbc.DropdownMenuItem("Item 1")],
label="Toggle",
color="lightcoral",
),
dbc.FormText("Text", color="lightsteelblue"),
dbc.ListGroup(
[
dbc.ListGroupItem("Item 1", color="fuchsia"),
dbc.ListGroupItem(
dbc.ListGroupItemText("Text", color="chocolate")
),
]
),
],
className="p-5",
),
]
)
if __name__ == "__main__":
app.run_server(debug=True)
Contributor
Author
|
I've sorted out the problems with hovering at the cost of 2 new requirements. Bundle size only goes up to 302KB though. What do you think? |
Contributor
Author
|
Reverted the hover colours, button is back to only allowing bootstrap contextual colours. |
tcbegley
requested changes
Jan 18, 2021
Collaborator
tcbegley
left a comment
There was a problem hiding this comment.
This looks great. If you could just put the Button test back in (looks like it got deleted in the back and forth on that component) I think this is ready to go.
Contributor
Author
|
Fixed! |
tcbegley
approved these changes
Jan 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allows the user to pass any valid css colour to the "color" property of components, as well as the bootstrap built in colours as before.