Skip to content

Commit

Permalink
Showing 24 changed files with 217 additions and 86 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -88,6 +88,16 @@ repos:
entry: gitleaks detect --verbose --redact --baseline-path .gitleaks-report.json
language: golang

- repo: https://github.com/awebdeveloper/pre-commit-stylelint
rev: "0.0.2"
hooks:
- id: stylelint
additional_dependencies:
- stylelint@16.2.1
- stylelint-config-standard@36.0.0
- stylelint-order@4.1.0
args: ["--fix"]

# Configuration for https://pre-commit.ci/.
ci:
autoupdate_schedule: monthly
13 changes: 13 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "stylelint-config-standard",
"plugins": ["stylelint-order"],
"rules": {
"order/properties-alphabetical-order": true,
"selector-class-pattern": null,
"custom-property-pattern": null,
"color-function-notation": "legacy",
"alpha-value-notation": "number",
"color-hex-length": "long",
"selector-not-notation": null
}
}
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
- A bullet item for the Removed 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))
-->
<!--
### 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))
-->
16 changes: 8 additions & 8 deletions vizro-ai/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
.card-section-wrapper {
display: flex;
align-items: center;
display: flex;
}

.responsive-grid {
display: grid;
width: 100%;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
grid-auto-rows: auto;
gap: 1.5rem;
grid-auto-rows: auto;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
width: 100%;
}

.card-section-wrapper .responsive-grid a {
text-decoration: none;
transition: none;
background: none;
padding: 0;
color: black;
padding: 0;
text-decoration: none;
transition: none;
}

.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
height: 100%;
transition: 0.3s;
}

.card:hover {
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
- A bullet item for the Removed 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))
-->
<!--
### 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))
-->
20 changes: 11 additions & 9 deletions vizro-core/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
.card-section-wrapper {
display: flex;
align-items: center;
display: flex;
}

.responsive-grid {
display: grid;
width: 100%;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
grid-auto-rows: auto;
gap: 1.5rem;
grid-auto-rows: auto;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
width: 100%;
}

.card-section-wrapper .responsive-grid a {
text-decoration: none;
transition: none;
background: none;
padding: 0;
color: black;
padding: 0;
text-decoration: none;
transition: none;
}

.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
height: 100%;
transition: 0.3s;
}

.card:hover {
@@ -45,18 +45,20 @@ td:not([class]):not(:last-child) {
:root {
--md-admonition-icon--details: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z"/></svg>');
}

.md-typeset .admonition.details,
.md-typeset details.details {
border-color: rgb(158, 158, 158);
}

.md-typeset .details > .admonition-title,
.md-typeset .details > summary {
background-color: rgba(245, 245, 245, 0.3);
opacity: 0.5;
}

.md-typeset .details > .admonition-title::before,
.md-typeset .details > summary::before {
background-color: rgb(3, 3, 3);
-webkit-mask-image: var(--md-admonition-icon--details);
mask-image: var(--md-admonition-icon--details);
}
2 changes: 1 addition & 1 deletion vizro-core/examples/_dev/assets/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#logo {
margin-left: -8px;
height: 40px;
margin-left: -8px;
}
6 changes: 3 additions & 3 deletions vizro-core/examples/demo/assets/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
img[src*="#my-image"] {
width: 100px;
height: 100px;
float: left;
height: 100px;
margin: 10px 25px;
width: 100px;
}

#logo {
margin-left: -8px;
height: 40px;
margin-left: -8px;
}
2 changes: 1 addition & 1 deletion vizro-core/examples/features/assets/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#logo {
margin-left: -8px;
height: 40px;
margin-left: -8px;
}
16 changes: 8 additions & 8 deletions vizro-core/src/vizro/static/css/accordion.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* media queries necessary for opening and closing accordion*/
/* media queries necessary for opening and closing accordion */
@media (prefers-reduced-motion: reduce) {
.fade {
transition: none;
@@ -51,13 +51,6 @@
color: var(--text-primary);
}

.accordion-button:not(.collapsed)::after {
background-position: left;
font-size: 16px;
font-weight: 600;
transform: scaleX(1.3) rotate(180deg);
}

.accordion-button::after {
background-repeat: no-repeat;
content: "\2304";
@@ -72,6 +65,13 @@
transition: transform 0.3s ease-in-out;
}

.accordion-button:not(.collapsed)::after {
background-position: left;
font-size: 16px;
font-weight: 600;
transform: scaleX(1.3) rotate(180deg);
}

.accordion-header {
font-size: var(--text-size-02);
}
4 changes: 2 additions & 2 deletions vizro-core/src/vizro/static/css/checklist.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
input[type="checkbox" i] {
align-items: center;
-webkit-appearance: none;
appearance: none;
border: 1px solid var(--text-secondary);
display: inline-flex;
height: 16px;
@@ -9,7 +9,7 @@ input[type="checkbox" i] {
width: 16px;
}

input[type="checkbox"]:checked:before {
input[type="checkbox"]:checked::before {
color: var(--text-primary);
content: "✓";
display: flex;
6 changes: 5 additions & 1 deletion vizro-core/src/vizro/static/css/collapse.css
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
transition: none;
}
}

.fade:not(.show) {
opacity: 0;
}
@@ -16,16 +17,19 @@
overflow: hidden;
transition: height 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
.collapsing {
transition: none;
}
}

.collapsing.collapse-horizontal {
width: 0;
height: auto;
transition: width 0.35s ease;
width: 0;
}

@media (prefers-reduced-motion: reduce) {
.collapsing.collapse-horizontal {
transition: none;
2 changes: 1 addition & 1 deletion vizro-core/src/vizro/static/css/container.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.page-component-container {
height: 100%;
display: flex;
flex-direction: column;
height: 100%;
}
24 changes: 12 additions & 12 deletions vizro-core/src/vizro/static/css/dropdown.css
Original file line number Diff line number Diff line change
@@ -47,6 +47,10 @@
margin-left: unset;
}

.Select-input > input {
padding: 0 !important; /* Required so tags don't jump caused by adding table */
}

#page-container.Select-input > input {
height: 100%;
padding: 0;
@@ -72,7 +76,7 @@
) !important; /* Required so text color don't change caused by adding table */
}

/* Tags ---------------------------*/
/* Tags --------------------------- */
#page-container .Select--multi .Select-value {
background-color: var(--tags-bg-color);
border: 0;
@@ -96,9 +100,9 @@

/* Tag: Cross */
#page-container .Select--multi .Select-value-icon {
color: var(--text-secondary);
background: inherit;
border: none;
color: var(--text-secondary);
line-height: inherit;
margin: 0;
padding: 0;
@@ -116,6 +120,11 @@
width: 16px;
}

#nav-panel a {
font-weight: var(--text-weight-regular);
line-height: var(--text-size-07);
}

/* Page Selector Dropdown */
#page-container
.dash-dropdown
@@ -130,14 +139,9 @@
width: 100%;
}

#nav-panel a {
font-weight: var(--text-weight-regular);
line-height: var(--text-size-07);
}

#page-container .Select--multi .Select-clear-zone {
width: 16px;
color: var(--text-secondary);
width: 16px;
}

/** spacing for tag elements only when elements are present inside
@@ -148,7 +152,3 @@ wrapper **/
gap: 4px;
padding: 4px 8px;
}

.Select-input > input {
padding: 0 !important; /* Required so tags don't jump caused by adding table */
}
6 changes: 3 additions & 3 deletions vizro-core/src/vizro/static/css/index.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
@font-face {
font-family: "Inter";
font-family: Inter;
src: url("./fonts/inter-variable-font.ttf") format("truetype");
}

@font-face {
font-family: "RobotoMono";
font-family: RobotoMono;
src: url("./fonts/roboto-mono-variable-font.ttf") format("truetype");
}

* {
border: 0;
box-sizing: border-box;
font-family: Inter, Sans-Serif, Arial, serif;
font-family: Inter, sans-serif, Arial, serif;
letter-spacing: 0;
margin: 0;
text-decoration: none;
29 changes: 16 additions & 13 deletions vizro-core/src/vizro/static/css/layout.css
Original file line number Diff line number Diff line change
@@ -45,11 +45,11 @@
background-color: var(--surfaces-bg-02);
display: flex;
flex-direction: row;
justify-content: space-between;
height: 64px;
justify-content: space-between;
min-height: 0;
padding: 0 32px;
width: 100%;
min-height: 0;
}

#page-header:not(:empty) {
@@ -62,8 +62,8 @@

.grid-layout {
display: grid;
width: 100%;
height: 100%;
width: 100%;
}

#nav-panel {
@@ -81,7 +81,7 @@
display: flex;
flex-direction: column;
gap: var(--spacing-06);
padding: 4px 0 24px 0;
padding: 4px 0 24px;
}

#control-panel:not(:empty) {
@@ -145,6 +145,7 @@ div.dashboard_container .custom-tooltip {
.icon-button.btn.btn-primary.active .material-symbols-outlined {
color: var(--text-active);
}

.loading-container {
height: 100%;
width: 100%;
@@ -155,7 +156,7 @@ div.dashboard_container .custom-tooltip {
border-radius: 0;
box-shadow: var(--box-shadow-elevation-tooltip-hover);
color: var(--tooltip-text-primary);
filter: drop-shadow(0px 2px 2px #141721);
filter: drop-shadow(0 2px 2px #141721);
font-size: var(--text-size-01);
font-weight: var(--text-weight-light);
letter-spacing: var(--letter-spacing-help-text);
@@ -203,33 +204,35 @@ div.dashboard_container .custom-tooltip {
}

#collapse-icon.material-symbols-outlined {
position: absolute;
background-color: var(--tooltip-bg-color);
border-radius: 50%;
cursor: pointer;
color: var(--text-disabled);
background-color: var(--tooltip-bg-color);
cursor: pointer;
position: absolute;
}

#collapse-icon.material-symbols-outlined:hover {
color: var(--text-active);
}

.collapse-button-tooltip {
height: 24px;
left: -12px;
position: relative;
top: 36px;
left: -12px;
height: 24px;
width: 0 !important;
}

/* Note: This is only meant as a quick-fix to improve some of the mobile layouts. */

/* Long-term wise this should be replaced by refactoring our CSS code and components to be mobile-compatible. */

/* Applies to device size x-small and small */
@media (max-width: 576px) {
@media (width <= 576px) {
.grid-layout {
display: flex;
flex-direction: column;
flex: 1;
flex-direction: column;
}

.collapse-button-tooltip {
@@ -249,7 +252,7 @@ div.dashboard_container .custom-tooltip {
}
}

@media (max-height: 576px) {
@media (height <= 576px) {
.collapse-button-tooltip {
top: 28px;
}
4 changes: 2 additions & 2 deletions vizro-core/src/vizro/static/css/radio_item.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
input[type="radio" i] {
-webkit-appearance: none;
appearance: none;
border: 1px solid var(--text-secondary);
border-radius: 50%;
height: 16px;
@@ -17,7 +17,7 @@ input[type="radio"]:focus {
box-shadow: 0 0 0 2px var(--text-secondary);
}

input[type="radio"]:checked:before {
input[type="radio"]:checked::before {
background-color: var(--text-primary);
border-radius: 50%;
content: "";
1 change: 1 addition & 0 deletions vizro-core/src/vizro/static/css/selectors.css
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
}

/* TODO: Consolidate gaps between all the containers. Check latest Figma design. */

/* Eventually remove the need for all the different containers afterwards. */
.selector_container,
.selector_dropdown_container,
11 changes: 6 additions & 5 deletions vizro-core/src/vizro/static/css/slider.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.rc-slider {
flex: auto;
height: 24px;
margin: 4px -12px 0 -12px;
margin: 4px -12px 0;
}

.rc-slider-rail,
@@ -35,7 +35,7 @@
border-color: var(--fill-on-active);
border-radius: 100%;
height: 16px;
margin: -8px 0 0 0;
margin: -8px 0 0;
position: absolute;
width: 16px;
}
@@ -86,11 +86,12 @@
}

.range_slider_control_no_space {
margin: 2px 8px -4px 0px;
padding: 0 30px 25px 30px !important;
margin: 2px 8px -4px 0;
padding: 0 30px 25px !important;
}

.range_slider_control {
padding: 0 30px 25px 30px !important;
padding: 0 30px 25px !important;
}

.slider_input_field_left,
3 changes: 2 additions & 1 deletion vizro-core/src/vizro/static/css/table.css
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
.dash-spreadsheet-inner
table {
--hover: var(--main-container-bg-color);

width: 100%;
}

@@ -47,8 +48,8 @@
}

#right-side .dash-table-container .previous-next-container {
padding: 4px 0;
font-size: 14px;
padding: 4px 0;
}

.table-container {
16 changes: 8 additions & 8 deletions vizro-core/src/vizro/static/css/toggle.css
Original file line number Diff line number Diff line change
@@ -3,12 +3,12 @@
}

#page-container .mantine-Switch-track {
min-width: 32px;
width: 32px;
height: 16px;
background-color: var(--fill-subtle);
border-radius: 16px;
border: 1px solid var(--border-enabled);
border-radius: 16px;
height: 16px;
min-width: 32px;
width: 32px;
}

#page-container .mantine-Switch-track:focus {
@@ -20,21 +20,21 @@
}

#page-container .mantine-Switch-trackLabel {
height: 16px;
margin: 0;
width: 32px;
height: 16px;
}

#page-container .mantine-Switch-thumb {
background-color: var(--fill-medium-emphasis);
border: none;
width: 10px;
height: 10px;
background-color: var(--fill-medium-emphasis);
width: 10px;
}

#page-container input:checked + * > .mantine-11dx59s {
left: calc(100% - 12px);
background: var(--text-contrast-primary);
left: calc(100% - 12px);
}

#page-container input:checked + * > .mantine-69c9zd {
2 changes: 1 addition & 1 deletion vizro-core/src/vizro/static/css/token_names.css
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
--text-dark-mode-placeholder: rgba(255, 255, 255, 0.38);
--text-dark-mode-primary: rgba(255, 255, 255, 0.88);
--text-dark-mode-secondary: rgba(255, 255, 255, 0.6);
--border-dark-mode-selected: #fff;
--border-dark-mode-selected: #ffffff;
--fill-dark-mode-subtle: rgba(255, 255, 255, 0.1);
--border-dark-mode-subtle-alpha-01: rgba(255, 255, 255, 0.1);
--status-dark-mode-success: rgba(64, 216, 110, 1);
2 changes: 1 addition & 1 deletion vizro-core/src/vizro/static/css/typography.css
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ code,
background: var(--surfaces-bg-card);
border-radius: 2px;
color: var(--text-primary);
font-family: RobotoMono, Inter, Sans-Serif, Arial, serif;
font-family: RobotoMono, Inter, sans-serif, Arial, serif;
font-size: var(--text-size-01);
font-weight: var(--text-weight-regular);
line-height: var(--text-size-03);
12 changes: 6 additions & 6 deletions vizro-core/src/vizro/static/css/user_input.css
Original file line number Diff line number Diff line change
@@ -10,6 +10,10 @@ textarea {
text-overflow: ellipsis;
}

textarea {
padding: var(--spacing-03) var(--spacing-03) var(--spacing-04);
}

.user_input {
gap: var(--spacing-02);
height: 32px;
@@ -25,10 +29,6 @@ textarea:enabled {
color: var(--text-primary);
}

textarea {
padding: var(--spacing-03) var(--spacing-03) var(--spacing-04);
}

.user_input:hover,
textarea:hover {
background: var(--field-hover);
@@ -43,7 +43,7 @@ textarea:focus {
outline: none;
}

/* Should be replaced by a custom icon at some point*/
/* Should be replaced by a custom icon at some point */
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
appearance: none;
}

0 comments on commit 106562c

Please sign in to comment.