Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Feature: dark mode #3264

Merged
merged 3 commits into from Jan 12, 2022
Merged

Feature: dark mode #3264

merged 3 commits into from Jan 12, 2022

Conversation

katspaugh
Copy link
Member

A poor man's dark mode using a CSS filter.

Screenshot 2022-01-10 at 13 32 46

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Jan 10, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@coveralls
Copy link

coveralls commented Jan 10, 2022

Pull Request Test Coverage Report for Build 1688233270

  • 0 of 10 (0.0%) changed or added relevant lines in 3 files are covered.
  • 52 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.08%) to 32.335%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/AppLayout/index.tsx 0 1 0.0%
src/routes/safe/components/Settings/Appearance/index.tsx 0 2 0.0%
src/logic/hooks/useDarkMode.ts 0 7 0.0%
Files with Coverage Reduction New Missed Lines %
src/routes/safe/components/Transactions/TxList/styled.tsx 1 43.28%
src/routes/safe/components/Transactions/TxList/TxCollapsed.tsx 1 5.94%
src/routes/safe/components/Transactions/TxList/TxExpandedActions.tsx 1 4.76%
src/routes/safe/components/Transactions/TxList/TxCollapsedActions.tsx 2 10.53%
src/routes/safe/components/Transactions/TxList/hooks/useTransactionStatus.ts 3 2.78%
src/components/TransactionFailText/index.tsx 4 38.46%
src/routes/safe/components/Transactions/TxList/TxDetails.tsx 20 4.23%
src/routes/safe/components/Transactions/TxList/utils.ts 20 37.25%
Totals Coverage Status
Change from base Build 1682013187: -0.08%
Covered Lines: 3116
Relevant Lines: 8575

💛 - Coveralls

html[class="darkMode"] div[style*="background-image"],
html[class="darkMode"] img:not([id="safe-logo"]) {
filter: invert(1) hue-rotate(180deg);
Copy link
Member

Choose a reason for hiding this comment

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

I don't necessarily agree with this because it is not interfacing with the theme. It is more 'high contrast mode'.

@liliiaorlenko wanted to put together a dark palette and then we actually use the dark theme in MUI.

Choose a reason for hiding this comment

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

so should I already provide the palette?

Copy link
Member

Choose a reason for hiding this comment

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

Creating a dark theme that uses MUI will need to be done incrementally. We will need the palette though to do so.

I don't know what the final decision should be on this ticket as it merely inverts colours. It won't need the palette here though.

Copy link
Member Author

Choose a reason for hiding this comment

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

@liliiaorlenko no, no rush, it was just a quick experiment.

@iamacook it's good enough for me personally, easier on the eyes, but I agree it's not a good long-term solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

@iamacook renamed to hi-contrast:
Screenshot 2022-01-10 at 17 41 55

@github-actions
Copy link

Deployment links

🟠 Safe Rinkeby Safe Mainnet 🟣 Safe Polygon 🟡 Safe BSC Safe Arbitrum 🟢 Safe xDai

import useCachedState from 'src/utils/storage/useCachedState'

const useDarkMode = (): [boolean, (mode: boolean) => void] => {
const [darkMode = false, setDarkMode] = useCachedState<boolean>('darkMode')
Copy link
Member

Choose a reason for hiding this comment

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

It should probably default to user preference to.

Copy link
Member

Choose a reason for hiding this comment

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

Even if this is just an experimental feature?

Copy link
Member

Choose a reason for hiding this comment

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

True, I didn't consider that. Perhaps not then.

@github-actions
Copy link

github-actions bot commented Jan 10, 2022

E2E Tests Failed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1682084678

Failed tests:

  • ❌ Safe Apps List Safe Apps List
  • ❌ Read-only transaction creation and review Read-only transaction creation and review
  • ❌ Safe Balances Safe Balances

@katspaugh katspaugh merged commit 1ff4b30 into dev Jan 12, 2022
@katspaugh katspaugh deleted the feat-dark-mode branch January 12, 2022 15:20
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants