Skip to content

Commit

Permalink
[TO Main] MET Web - Replace hover & background colors (#2424)
Browse files Browse the repository at this point in the history
* DESENG-520: Changed background color white to use bcds-surface-background-white

* DESENG-520: Updating hover color for white

* DESENG-520: Updated changelog

* Changelog fix

* DESENG-520: Removed inline style for language selector
  • Loading branch information
ratheesh-aot authored Mar 21, 2024
1 parent fc09bc6 commit b3dd910
Show file tree
Hide file tree
Showing 27 changed files with 77 additions and 33 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## March 21, 2024

- **Task**: MET Web - Replace hover & background colours [DESENG-520](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-520)
- Update Table and Menu Dropdown hover colors
- Update engagement tiles hover color.
- Updated all white backgrounds to use css variable.

## March 19, 2024

- **Task**: Add poll results to results tab [DESENG-513](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-513)
Expand Down
11 changes: 11 additions & 0 deletions met-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions met-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
"dependencies": {
"@arcgis/core": "^4.26.5",
"@bcgov/bc-sans": "^2.0",
"@bcgov/design-tokens": "^2.0.1",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@formio/react": "^5.3.0",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-brands-svg-icons": "^6.1.1",
"@fortawesome/free-regular-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.1.18",
"@hello-pangea/dnd": "^16.2.0",
"@hookform/resolvers": "^2.9.8",
"@mui/icons-material": "^5.8.3",
Expand Down Expand Up @@ -68,12 +74,7 @@
"typescript": "^4.6.3",
"universal-cookie": "^7.0.1",
"web-vitals": "^2.1.4",
"yup": "^0.32.11",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-brands-svg-icons": "^6.1.1",
"@fortawesome/free-regular-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.1.18"
"yup": "^0.32.11"
},
"scripts": {
"start": "react-app-rewired start",
Expand Down
21 changes: 20 additions & 1 deletion met-web/src/App.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@charset "UTF-8";

@import '@bcgov/design-tokens/css-prefixed/variables';

#main {
margin-top: 10px;
Expand All @@ -23,3 +23,22 @@ code {
padding-right: 0;
}
}

/** Overriding Select Menu Dropdown color **/
// Background white and on hover light grey
.MuiMenuItem-root {
background-color: var(--bcds-surface-background-white) !important;
&:hover {
background-color: var(--bcds-surface-secondary-hover) !important;
}
}

/** Overriding Met table styles **/
// set background color of tr to white
.MuiTable-root tbody > tr {
background-color: var(--bcds-surface-background-white) !important;
}
// set background color of tr on hover to light gray
tbody.MuiTableBody-root > tr:hover {
background-color: var(--bcds-surface-secondary-hover) !important;
}
3 changes: 2 additions & 1 deletion met-web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
import '@bcgov/design-tokens/css-prefixed/variables.css'; // Will be available to use in all component
import './App.scss';
import { Route, BrowserRouter as Router, Routes } from 'react-router-dom';
import UserService from './services/userService';
Expand Down Expand Up @@ -245,7 +246,7 @@ const App = () => {
</Box>
<Box
sx={{
backgroundColor: 'white',
backgroundColor: 'var(--bcds-surface-background-white)',
zIndex: ZIndex.footer,
position: 'relative',
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function EmailPreview({
}

const container = {
backgroundColor: '#ffffff',
backgroundColor: 'var(--bcds-surface-background-white)',
border: '1px solid #eee',
borderRadius: '5px',
boxShadow: '0 5px 10px rgba(20,50,70,.2)',
Expand Down
2 changes: 1 addition & 1 deletion met-web/src/components/common/LanguageSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const LanguageSelector = () => {
value={language.id}
size="small"
sx={{
backgroundColor: 'white',
backgroundColor: 'var(--bcds-surface-background-white)',
color: Palette.info.main,
minWidth: '8ch',
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const AdditionalTabContent = () => {
marginTop={2}
zIndex={1000}
boxShadow="0px 0px 5px rgba(0, 0, 0, 0.1)"
sx={{ backgroundColor: 'white' }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)' }}
>
<Grid item xs={12}>
<PrimaryButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ const EngagementForm = () => {
marginTop={2}
zIndex={1000}
boxShadow="0px 0px 5px rgba(0, 0, 0, 0.1)"
sx={{ backgroundColor: 'white' }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)' }}
>
<Grid item xs={12}>
<PrimaryButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const EngagementResults = () => {
marginTop={2}
zIndex={1000}
boxShadow="0px 0px 5px rgba(0, 0, 0, 0.1)"
sx={{ backgroundColor: 'white' }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)' }}
>
<Grid item xs={12}>
<PrimaryButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const EngagementSettingsForm = () => {
marginTop={2}
zIndex={1000}
boxShadow="0px 0px 5px rgba(0, 0, 0, 0.1)"
sx={{ backgroundColor: 'white' }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)' }}
>
<Grid item xs={12}>
<PrimaryButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const ActionsDropDown = ({ membership }: { membership: EngagementTeamMemb
value={0}
fullWidth
size="small"
sx={{ backgroundColor: 'white', color: Palette.info.main }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)', color: Palette.info.main }}
>
<MenuItem value={0} sx={{ fontStyle: 'italic', height: '2em' }} color="info" disabled>
{'(Select One)'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const EngagementUserManagement = () => {
marginTop={2}
zIndex={1000}
boxShadow="0px 0px 5px rgba(0, 0, 0, 0.1)"
sx={{ backgroundColor: 'white' }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)' }}
>
<Grid item xs={12}>
<PrimaryButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const ActionsDropDown = ({ engagement }: { engagement: Engagement }) => {
value={0}
fullWidth
size="small"
sx={{ backgroundColor: 'white', color: Palette.info.main }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)', color: Palette.info.main }}
>
<MenuItem value={0} sx={{ fontStyle: 'italic', height: '2em' }} color="info" disabled>
{'(Select One)'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface PhaseBoxProps {
}
export const PhaseBox = ({
title,
backgroundColor = 'white',
backgroundColor = 'var(--bcds-surface-background-white)',
learnMoreBox,
iconBox,
currentPhase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface PhaseBoxProps {
}
export const PhaseBoxMobile = ({
title,
backgroundColor = 'white',
backgroundColor = 'var(--bcds-surface-background-white)',
learnMoreBox,
iconBox,
accordionBackground,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const TimelineWidgetView = ({ widget }: TimelineWidgetProps) => {
const commonWhiteAvatarStyles = {
height: 23,
width: 23,
backgroundColor: '#FFF',
backgroundColor: 'var(--bcds-surface-background-white)',
};

const renderIcon = (status: EventStatus) => {
Expand Down
2 changes: 1 addition & 1 deletion met-web/src/components/feedback/actionDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const ActionsDropDown = ({ feedback, reload }: { feedback: Feedback; relo
value={0}
fullWidth
size="small"
sx={{ backgroundColor: 'white', color: Palette.info.main }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)', color: Palette.info.main }}
>
<MenuItem value={0} sx={{ fontStyle: 'italic', height: '2em' }} color="info" disabled>
{'(Select One)'}
Expand Down
2 changes: 1 addition & 1 deletion met-web/src/components/imageUpload/cropModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const CropModal = () => {
}}
style={{
containerStyle: {
backgroundColor: '#fff',
backgroundColor: 'var(--bcds-surface-background-white)',
},
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion met-web/src/components/landing/EngagementTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const EngagementTile = ({ passedEngagement, engagementId }: EngagementTileProps)
sx={{
maxWidth: 345,
'&:hover': {
backgroundColor: '#F2F2F2',
backgroundColor: 'var(--bcds-surface-secondary-hover)',
cursor: 'pointer',
},
}}
Expand Down
2 changes: 1 addition & 1 deletion met-web/src/components/layout/SideNav/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const DrawerBox = () => {
</ListItemButton>
</ListItem>
))}
<Divider sx={{ backgroundColor: 'white' }} />
<Divider sx={{ backgroundColor: 'var(--bcds-surface-background-white)' }} />
<UserGuideNav />
</List>
</Box>
Expand Down
7 changes: 6 additions & 1 deletion met-web/src/components/map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ const MetMap = ({ geojson, latitude, longitude, markerLabel, zoom }: MapProps) =
<Stack direction="column" alignItems="center" justifyContent="center">
<MarkerIcon fontSize="large" htmlColor="red" />
<When condition={Boolean(markerLabel)}>
<MetSmallText bold bgcolor={'white'} borderRadius="10px" padding="0 2px 0 2px">
<MetSmallText
bold
bgcolor={'var(--bcds-surface-background-white)'}
borderRadius="10px"
padding="0 2px 0 2px"
>
{markerLabel}
</MetSmallText>
</When>
Expand Down
4 changes: 2 additions & 2 deletions met-web/src/components/publicDashboard/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const DASHBOARD = {
FILL_COLOR: '#4C81AF',
},
SURVEY_RESULT: {
BACKGROUND_COLOR: '#FFFFFF',
HOVER_COLOR: '#F2F2F2',
BACKGROUND_COLOR: 'var(--bcds-surface-background-white)',
HOVER_COLOR: 'var(--bcds-surface-secondary-hover)',
SELECTED_TEXT_COLOR: '#494949',
},
};
2 changes: 1 addition & 1 deletion met-web/src/components/survey/listing/ActionsDropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const ActionsDropDown = ({ survey }: { survey: Survey }) => {
value={0}
fullWidth
size="small"
sx={{ backgroundColor: 'white', color: Palette.info.main }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)', color: Palette.info.main }}
>
<MenuItem value={0} sx={{ fontStyle: 'italic', height: '2em' }} color="info" disabled>
{'(Select One)'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const ActionsDropDown = ({ selectedUser }: { selectedUser: User }) => {
value={0}
fullWidth
size="small"
sx={{ backgroundColor: 'white', color: Palette.info.main }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)', color: Palette.info.main }}
>
<MenuItem value={0} sx={{ fontStyle: 'italic', height: '2em' }} color="info" disabled>
{'(Select One)'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const ActionsDropDown = ({ membership }: { membership: EngagementTeamMemb
value={0}
fullWidth
size="small"
sx={{ backgroundColor: 'white', color: Palette.info.main }}
sx={{ backgroundColor: 'var(--bcds-surface-background-white)', color: Palette.info.main }}
>
<MenuItem value={0} sx={{ fontStyle: 'italic', height: '2em' }} color="info" disabled>
{'(Select One)'}
Expand Down
6 changes: 3 additions & 3 deletions met-web/src/styles/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const Palette = {
light: '#FFE082',
},
hover: {
light: '#4C81AF',
light: 'var(--bcds-surface-primary-hover)',
},
text: {
primary: '#494949',
Expand All @@ -24,11 +24,11 @@ export const Palette = {
main: '#707070',
},
internalHeader: {
backgroundColor: '#FFFFFF',
backgroundColor: 'var(--bcds-surface-background-white)',
color: '#292929',
},
publicHeader: {
backgroundColor: '#FFFFFF',
backgroundColor: 'var(--bcds-surface-background-white)',
color: '#292929',
},
dashboard: {
Expand Down

0 comments on commit b3dd910

Please sign in to comment.