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 all CSS variables and tokens #886

Merged
merged 45 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
81eeb60
Add changes
huong-li-nguyen Nov 18, 2024
5f0e020
Update latest CSS file
huong-li-nguyen Nov 19, 2024
fff42a1
Remove CSS for tooltip
huong-li-nguyen Nov 19, 2024
07d8929
Update vizro-bootstrap.min.css
huong-li-nguyen Nov 19, 2024
0a7ff33
Create 20241119_155853_huong_li_nguyen_add_bs_tooltip_styling.md
huong-li-nguyen Nov 19, 2024
7abbbbf
Merge branch 'main' into tidy/add-bs-tooltip-styling
huong-li-nguyen Nov 19, 2024
480914d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 19, 2024
4a598a2
Remove all CSS variables
huong-li-nguyen Nov 19, 2024
39032be
Rename variables with vizro-bs equivalent
huong-li-nguyen Nov 19, 2024
1ca73f8
Replace with rem units
huong-li-nguyen Nov 19, 2024
610a188
Hardcode values where suitable
huong-li-nguyen Nov 19, 2024
96464d6
Add back selected variables
huong-li-nguyen Nov 19, 2024
e35fe36
Replace matched values
huong-li-nguyen Nov 19, 2024
3404355
Replace remaining values
huong-li-nguyen Nov 19, 2024
4d07ec0
Create 20241119_173819_huong_li_nguyen_remove_variables.md
huong-li-nguyen Nov 19, 2024
5a47f97
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 19, 2024
e7cdc9b
Merge branch 'tidy/add-bs-tooltip-styling' into tidy/remove-variables
huong-li-nguyen Nov 19, 2024
1277f11
Merge branch 'tidy/remove-variables' of https://github.com/mckinsey/v…
huong-li-nguyen Nov 19, 2024
b52fb72
Fix collapse bg color
huong-li-nguyen Nov 20, 2024
42bdb3a
Update color
huong-li-nguyen Nov 20, 2024
0742dc8
Fix renaming of border
huong-li-nguyen Nov 20, 2024
ba273f7
Replace remaining variable mentions
huong-li-nguyen Nov 20, 2024
307ce5c
Merge branch 'main' into tidy/remove-variables
huong-li-nguyen Nov 20, 2024
84d5d73
Update CSS variables outside of static folder
huong-li-nguyen Nov 21, 2024
2ec7c6e
Revert demo changes
huong-li-nguyen Nov 21, 2024
4fac651
Update changelog
huong-li-nguyen Nov 21, 2024
c77fd12
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2024
f9bba27
Update table
huong-li-nguyen Nov 21, 2024
bf90f2c
Merge branch 'main' into tidy/remove-variables
huong-li-nguyen Nov 21, 2024
e0c9f20
Fix tabs
huong-li-nguyen Nov 21, 2024
96fcd96
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2024
4600223
Merge branch 'main' into tidy/remove-variables
huong-li-nguyen Nov 25, 2024
de7781e
Clarify comment
huong-li-nguyen Nov 25, 2024
7b3e2e3
Add comment
huong-li-nguyen Nov 25, 2024
9358742
Update docs
huong-li-nguyen Nov 26, 2024
e9be97e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 26, 2024
c18f942
Lint
huong-li-nguyen Nov 26, 2024
a9dd04d
Merge branch 'tidy/remove-variables' of https://github.com/mckinsey/v…
huong-li-nguyen Nov 26, 2024
26046be
Update
huong-li-nguyen Nov 26, 2024
bf1a006
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 26, 2024
aaf36a3
Fix typo
huong-li-nguyen Nov 26, 2024
84eaafb
Update custom-css.md
huong-li-nguyen Nov 26, 2024
30852b3
Merge branch 'main' into tidy/remove-variables
huong-li-nguyen Nov 26, 2024
06e813a
Update custom-css.md
huong-li-nguyen Nov 26, 2024
2786afe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨

- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->

### Removed

- Removed all CSS variables from `variables.css` and `token_names.css`, replacing them with CSS variables from `vizro-bootstrap.min.css`.
Refer to [`vizro-bootstrap.min.css](https://github.com/mckinsey/vizro/blob/main/vizro-core/src/vizro/static/css/vizro-bootstrap.min.css) for the updated CSS variables. ([#886](https://github.com/mckinsey/vizro/pull/886))
huong-li-nguyen marked this conversation as resolved.
Show resolved Hide resolved

<!--
### Added

- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Changed

- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Deprecated

- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Fixed

- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Security

- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
6 changes: 3 additions & 3 deletions vizro-core/docs/pages/user-guides/custom-tables.md
antonymilne marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ The following examples show a possible version of a custom table. In this case t
columns = [{"name": i, "id": i} for i in chosen_columns]
defaults = {
"style_as_list_view": True,
"style_data": {"border_bottom": "1px solid var(--border-subtle-alpha-01)", "height": "40px"},
"style_data": {"border_bottom": "1px solid var(--border-subtleAlpha01)", "height": "40px"},
"style_header": {
"border_bottom": "1px solid var(--state-overlays-selected-hover)",
"border_top": "1px solid var(--main-container-bg-color)",
"border_bottom": "1px solid var(--stateOverlays-selectedHover)",
"border_top": "1px solid var(--right-side-bg)",
"height": "32px",
},
}
Expand Down
77 changes: 38 additions & 39 deletions vizro-core/src/vizro/static/css/aggrid.css
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
.ag-theme-quartz.ag-theme-vizro,
.ag-theme-quartz-dark.ag-theme-vizro {
--ag-active-color: var(--state-overlays-selected-hover);
--ag-background-color: var(--main-container-bg-color);
--ag-odd-row-background-color: var(--main-container-bg-color);
--ag-active-color: var(--stateOverlays-selectedHover);
--ag-background-color: var(--right-side-bg);
--ag-odd-row-background-color: var(--right-side-bg);
--ag-header-foreground-color: var(--text-secondary);
--ag-data-color: var(--text-primary);
--ag-header-background-color: var(--main-container-bg-color);
--ag-header-background-color: var(--right-side-bg);
--ag-icon-font-family: aggridquartz;
--ag-icon-size: var(--text-size-02);
--ag-icon-size: 0.875rem;
--ag-row-height: 48px;
--ag-header-height: 40px;
--ag-borders: none;
--ag-border-radius: 0;
--ag-border-color: transparent;
--ag-row-border-style: solid;
--ag-row-border-color: var(--border-subtle-alpha-01);
--ag-row-border-color: var(--border-subtleAlpha01);
--ag-row-border-width: 1px;
--ag-selected-row-background-color: var(--state-overlays-selected);
--ag-selected-row-background-color: var(--stateOverlays-selected);
--ag-checkbox-checked-color: var(--text-primary);
--ag-header-column-resize-handle-display: block;
--ag-header-column-resize-handle-height: 30%;
--ag-header-column-resize-handle-width: 1px;
--ag-header-column-resize-handle-color: var(--border-subtle-alpha-02);
--ag-header-column-resize-handle-color: var(--border-subtleAlpha02);
--ag-range-selection-border-color: transparent;
--ag-input-focus-border-color: transparent;
}

/* Header ------- */
#dashboard-container .ag-header-row {
align-items: flex-start;
border-bottom: 1px solid var(--border-subtle-alpha-02);
border-bottom: 1px solid var(--border-subtleAlpha02);
display: flex;
}

#dashboard-container .ag-header-cell {
align-items: center;
display: flex;
height: 40px;
padding: 0 var(--spacing-03);
padding: 0 0.75rem;
}

#dashboard-container .ag-header-cell-text {
letter-spacing: -0.112px;
line-height: var(--spacing-04);
line-height: 1rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand All @@ -55,32 +55,32 @@

/* Rows ------- */
#dashboard-container .ag-cell {
padding: 0 var(--spacing-03);
padding: 0 0.75rem;
}

#dashboard-container .ag-cell-focus {
border: none;
}

#dashboard-container .ag-cell-focus:not(.ag-cell-range-selected):focus-within {
background: var(--state-overlays-selected);
background: var(--stateOverlays-selected);
}

/* Pop up menu ----- */
#dashboard-container .ag-menu {
background-color: var(--surfaces-bg-02);
border: 1px solid var(--border-subtle-alpha-02);
background-color: var(--surfaces-bg02);
border: 1px solid var(--border-subtleAlpha02);
color: var(--text-primary);
}

#dashboard-container .ag-ltr .ag-filter-filter input {
background-color: var(--field-enabled);
box-shadow: var(--box-shadow-elevation-0);
box-shadow: var(--elevation-0);
display: flex;
font-size: var(--text-size-02);
font-weight: var(--text-weight-regular);
letter-spacing: var(--letter-spacing-body-ui-02);
line-height: var(--text-size-03);
font-size: 0.875rem;
font-weight: 400;
letter-spacing: -0.112px;
line-height: 1rem;
text-overflow: ellipsis;
}

Expand All @@ -89,24 +89,24 @@
border: none;
border-radius: 0;
box-shadow: none;
font-size: var(--text-size-02);
font-size: 0.875rem;
}

#dashboard-container .ag-filter-select .ag-picker-field-wrapper {
background-color: var(--field-enabled);
box-shadow: var(--box-shadow-elevation-0);
box-shadow: var(--elevation-0);
}

#dashboard-container .ag-select-list {
background-color: var(--field-enabled);
box-shadow: var(--box-shadow-elevation-0);
box-shadow: var(--elevation-0);
color: var(--text-primary);
font-size: var(--text-size-02);
line-height: var(--text-size-05);
font-size: 0.875rem;
huong-li-nguyen marked this conversation as resolved.
Show resolved Hide resolved
line-height: 1.5rem;
}

#dashboard-container .ag-select-list-item.ag-active-item {
background-color: var(--state-overlays-hover);
background-color: var(--stateOverlays-hover);
}

#dashboard-container .ag-radio-button-input-wrapper {
Expand All @@ -123,12 +123,12 @@

#dashboard-container .ag-filter-apply-panel {
justify-content: flex-start;
padding: var(--spacing-02) 0 var(--spacing-03) 0;
padding: 0.5rem 0 0.75rem;
}

#dashboard-container .ag-filter-condition {
justify-content: flex-start;
padding: var(--spacing-02) var(--spacing-01);
padding: 0.5rem 0.25rem;
}

/* Scroll Bar */
Expand Down Expand Up @@ -157,28 +157,27 @@
padding-left: 0;
}

/* Buttons */
#dashboard-container .ag-standard-button {
background: var(--fill-active);
border: none;
border-radius: 0;
box-shadow: var(--box-shadow-elevation-0);
color: var(--text-contrast-primary);
font-size: var(--text-size-02);
font-weight: var(--text-weight-semibold);
box-shadow: var(--elevation-0);
color: var(--text-primary-inverted);
font-size: 0.875rem;
font-weight: 600;
height: 32px;
letter-spacing: var(--letter-spacing-body-link-02);
line-height: var(--text-size-05);
padding: var(--spacing-01) var(--spacing-03);
letter-spacing: -0.028px;
line-height: 1.5rem;
padding: 0.25rem 0.75rem;
text-transform: none;
}

#dashboard-container .ag-standard-button:hover {
background: linear-gradient(
var(--state-overlays-contrast-hover),
var(--state-overlays-contrast-hover)
var(--stateOverlays-hover-inverted),
var(--stateOverlays-hover-inverted)
),
var(--fill-active);
color: var(--text-contrast-primary);
color: var(--text-primary-inverted);
text-decoration-line: underline;
}
29 changes: 27 additions & 2 deletions vizro-core/src/vizro/static/css/bootstrap_overwrites.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
/* This file contains overwrites, which we want to have as defaults for vizro
but do not want to take over to `vizro-bootstrap` as these settings might not be generic enough. */
/* This file contains overwrites, which we want to have as defaults for vizro framework
but do not want to take over to `vizro-bootstrap` as these settings might not be generic enough
for a pure Dash app. */
[data-bs-theme="dark"] {
--dropdown-label-bg: var(--primary-800);
--right-side-bg: var(--surfaces-bg03);
--text-code-string: #95c2e7;
--text-code-keyword: #f4766e;
--text-code-meta: #c8ace1;
--text-code-type: #f69d50;
--text-code-literal: #6bb5fd;
huong-li-nguyen marked this conversation as resolved.
Show resolved Hide resolved
--slider-rail-bg: var(--primary-100);
--collapse-icon-bg: var(--primary-500);
}

[data-bs-theme="light"] {
--dropdown-label-bg: var(--primary-300);
--right-side-bg: var(--surfaces-bg01);
--text-code-string: #0a3069;
--text-code-keyword: #d12d39;
--text-code-meta: #6f42c1;
--text-code-type: #f69d50;
--text-code-literal: #005cc5;
--fill-icon-image-card: invert(64%) sepia(0%) saturate(1375%);
--slider-rail-bg: var(--primary-900);
--collapse-icon-bg: var(--primary-300);
}

.card .nav-link {
height: 100%;
Expand Down
5 changes: 0 additions & 5 deletions vizro-core/src/vizro/static/css/container.css

This file was deleted.

30 changes: 15 additions & 15 deletions vizro-core/src/vizro/static/css/datepicker.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.datepicker .mantine-Input-wrapper {
font-family: unset;
height: var(--spacing-08);
height: 2rem;
}

.datepicker .mantine-DateRangePicker-input,
.datepicker .mantine-DatePicker-input {
background-color: var(--field-enabled);
border: none;
border-radius: 0;
box-shadow: var(--box-shadow-elevation-0);
box-shadow: var(--elevation-0);
color: var(--text-secondary);
font-size: var(--text-size-02);
height: var(--spacing-08);
line-height: var(--spacing-04);
min-height: var(--spacing-08);
padding: 0 var(--spacing-02);
font-size: 0.875rem;
height: 2rem;
line-height: 1rem;
min-height: 2rem;
padding: 0 0.5rem;
}

.datepicker .mantine-DateRangePicker-input:hover,
Expand All @@ -27,8 +27,8 @@
background: var(--field-enabled);
border: none;
border-radius: 0;
box-shadow: var(--box-shadow-elevation-1);
padding: var(--spacing-04) 11px; /* 11px otherwise not aligned with controls */
box-shadow: var(--elevation-1);
padding: 1rem 11px; /* 11px otherwise not aligned with controls */
}

.datepicker .mantine-UnstyledButton-root {
Expand All @@ -39,15 +39,15 @@
}

.datepicker .mantine-UnstyledButton-root:hover {
background: var(--state-overlays-hover);
background: var(--stateOverlays-hover);
color: var(--text-primary);
}

.datepicker .mantine-DateRangePicker-weekday,
.datepicker .mantine-DatePicker-weekday {
color: var(--text-secondary);
font-family: unset;
padding: var(--spacing-02);
padding: 0.5rem;
}

.datepicker .mantine-DateRangePicker-cell,
Expand Down Expand Up @@ -75,15 +75,15 @@
.datepicker .mantine-DateRangePicker-day:focus-visible,
.datepicker .mantine-DatePicker-day:hover,
.datepicker .mantine-DatePicker-day:focus-visible {
background: var(--state-overlays-hover);
background: var(--stateOverlays-hover);
border: none;
color: var(--text-primary);
outline: none;
text-decoration: none;
}

.datepicker .mantine-DateRangePicker-day[data-in-range] {
background: var(--state-overlays-selected);
background: var(--stateOverlays-selected);
color: var(--text-primary);
}

Expand All @@ -93,8 +93,8 @@
.datepicker .mantine-DatePicker-day[data-selected],
.datepicker .mantine-DatePicker-yearPickerControlActive,
.datepicker .mantine-DatePicker-monthPickerControlActive {
background: var(--state-overlays-selected-inverse);
color: var(--text-contrast-primary);
background: var(--stateOverlays-selected-inverted);
color: var(--text-primary-inverted);
text-decoration: underline;
}

Expand Down
Loading