Skip to content

Commit

Permalink
Fix CSS alignment bugs and add more templates (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
huong-li-nguyen authored Oct 11, 2023
1 parent b49a42b commit 76c775e
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Removed
- A bullet item for the Removed category.
-->

### Added

- Add plotly layout template for waterfall chart type ([#106](https://github.com/mckinsey/vizro/pull/106))
- Add CSS default styling for `textarea` ([#106](https://github.com/mckinsey/vizro/pull/106))

<!--
### Changed
- A bullet item for the Changed category.
-->
<!--
### Deprecated
- A bullet item for the Deprecated category.
-->

### Fixed

- Fix alignment between control panel, dashboard title and page title ([#106](https://github.com/mckinsey/vizro/pull/106))

<!--
### Security
- A bullet item for the Security category.
-->
15 changes: 15 additions & 0 deletions vizro-core/src/vizro/_themes/_templates/template_dark.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ def create_template_dark() -> Template:
)
]

template_dark.data.waterfall = [
go.Waterfall(
decreasing={"marker": {"color": COLORS["DISCRETE_10"][1]}},
increasing={"marker": {"color": COLORS["DISCRETE_10"][0]}},
totals={"marker": {"color": COLORS["GREY_55"]}},
textfont_color=template_dark.layout.title.font.color,
textposition="outside",
connector={
"line": {
"color": template_dark.layout.xaxis.tickcolor,
"width": 1,
}
},
)
]
return template_dark


Expand Down
11 changes: 11 additions & 0 deletions vizro-core/src/vizro/_themes/_templates/template_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ def create_template_light() -> Template:
)
]

template_light.data.waterfall = [
go.Waterfall(
decreasing={"marker": {"color": COLORS["DISCRETE_10"][1]}},
increasing={"marker": {"color": COLORS["DISCRETE_10"][0]}},
totals={"marker": {"color": COLORS["GREY_30"]}},
textfont_color=template_light.layout.title.font.color,
textposition="outside",
connector={"line": {"color": template_light.layout.xaxis.tickcolor, "width": 1}},
)
]

return template_light


Expand Down
1 change: 1 addition & 0 deletions vizro-core/src/vizro/static/css/accordion.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
display: flex;
flex-direction: column;
overflow-x: hidden;
margin-top: -10px;
}

.accordion_item {
Expand Down
5 changes: 0 additions & 5 deletions vizro-core/src/vizro/static/css/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
top: -8px;
}

blockquote {
border-left: var(--spacing-01) var(--text-secondary) solid;
padding-left: var(--spacing-01);
}

.card_button {
height: 84%;
position: absolute;
Expand Down
13 changes: 4 additions & 9 deletions vizro-core/src/vizro/static/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
display: flex;
flex: 0 0 auto;
flex-direction: column;
padding: 30px 32px 0 32px;
scrollbar-gutter: stable;
padding: 40px 32px 0 32px;
width: 352px;
overflow: auto;
gap: var(--spacing-04);
Expand Down Expand Up @@ -58,7 +57,7 @@
display: flex;
flex-direction: column;
gap: var(--spacing-06);
padding: 0 0 24px 0;
padding: 4px 0 24px 0;
}

.page_error_container {
Expand Down Expand Up @@ -87,12 +86,8 @@
width: 336px;
}

hr {
border-bottom: 1px solid var(--border-subtle-alpha-01);
width: 100%;
}

.dashboard_title_outer {
display: flex;
flex-direction: column;
width: 100%;
height: 32px;
}
19 changes: 19 additions & 0 deletions vizro-core/src/vizro/static/css/types.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
textarea {
background-color: var(--field-enabled);
padding: var(--spacing-02);
}

textarea:focus {
outline: none;
box-shadow: 0 0 0 2px var(--focus-focus) inset;
}

hr {
border-bottom: 1px solid var(--border-subtle-alpha-01);
width: 100%;
}

blockquote {
border-left: var(--spacing-01) var(--text-secondary) solid;
padding-left: var(--spacing-01);
}

0 comments on commit 76c775e

Please sign in to comment.