Skip to content
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

[Tidy] Remove redundant CSS and add updated bootstrap file #931

Merged
merged 16 commits into from
Dec 17, 2024

Conversation

huong-li-nguyen
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen commented Dec 16, 2024

Description

  • Remove collapse.css (redundant since we load in the bootstrap theme now)
  • Simplify CSS for table.css (noticed a lot of complex selectors, I just simplified it)
  • Move some CSS for Card from bootstrap-theme to static folder
  • Load in updated bootstrap file based on merged PR: https://github.com/McK-Private/vizro-bootstrap/pull/44
  • Updated screenshots in https://github.com/mckinsey/vizro-qa/pull/141 due to:
    • Token for text-secondary has changed
    • Removed bottom padding for Dash DataTable
    • Apply text-primaryHover color for nav links

Screenshot

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorized to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorized by the Apache 2.0 license does not violate the intellectual property rights of anyone else.
    • I have not referenced individuals, products or companies in any commits, directly or indirectly.
    • I have not added data or restricted code in any commits, directly or indirectly.

@@ -1,37 +0,0 @@
@media (prefers-reduced-motion: reduce) {
Copy link
Contributor Author

@huong-li-nguyen huong-li-nguyen Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we've added this back then, because there was no bootstrap theme loaded by default, right? @nadijagraca All of this shouldn't be required anymore given that there is a bootstrap CSS file loaded now. I checked the example apps and it seems to work fine 👍 But could you double-check any apps for which you initially added this CSS in? Was it just for the collapse button? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to let you know that there is no longer a smooth collapsing transition when the control panel is collapsed/expanded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I noticed, but I didn't think it was that bad for it to need custom static CSS. I rather live with the default collapse behaviour from Bootstrap and have no static CSS 😬

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxschulz-COL @nadijagraca Do you have any thoughts on this? I think we should keep the collapse transition as done in the main branch, bug I'm okay to remove it if you agree.

Copy link
Contributor

github-actions bot commented Dec 16, 2024

View the example dashboards of the current commit live on PyCafe ☕ 🚀

Updated on: 2024-12-17 09:38:06 UTC
Commit: 47e88d0

Link: vizro-core/examples/dev/

Link: vizro-core/examples/scratch_dev

Link: vizro-core/examples/visual-vocabulary/

Link: vizro-ai/examples/dashboard_ui/

@huong-li-nguyen huong-li-nguyen self-assigned this Dec 16, 2024
@huong-li-nguyen huong-li-nguyen changed the title Tidy/remove redundant css [Tidy] Remove redundant CSS and add updated bootstrap file Dec 16, 2024
Copy link
Contributor

@maxschulz-COL maxschulz-COL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐ 🧹

vizro-core/src/vizro/static/css/table.css Show resolved Hide resolved
Copy link
Contributor

@nadijagraca nadijagraca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work! I love seeing all those selectors removed. 🧹 ✨ 🚀

font-size: 14px;
/* Styling for pagination element */
#dashboard-container .first-page,
#dashboard-container .previous-page,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming you are repeating #dashboard-container for higher specificity? I'm just curious would we achieve the same result without the repetition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be fine without it. However, if you take a look at the console in the current scratch dev example, you'll see that one dash selector actually has a higher specificity. So if we remove the dashboard-container id, the only reason this works is because the current dash selector does not have these properties defined. In this case, it's just safer to add it, so our selector always has higher specificity.

Screenshot 2024-12-17 at 13 42 08

@huong-li-nguyen huong-li-nguyen merged commit 3d8e17a into main Dec 17, 2024
36 checks passed
@huong-li-nguyen huong-li-nguyen deleted the tidy/remove-redundant-css branch December 17, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants