-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add styles for dark mode * feat: add further styles for dark mode * docs: add mutation observer for dark mode class * test: add visual regression tests for dark mode * docs: fix button border in docs landing page * docs: add dark mode feature to landing page * docs: add logo for dark mode * docs: add tip for dark mode
- Loading branch information
1 parent
1dfdcd2
commit 7d42539
Showing
31 changed files
with
298 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import PageObject from "../support/page-object"; | ||
|
||
const { | ||
setMonthMode, | ||
setDayMode, | ||
} = PageObject | ||
|
||
describe('Dark mode on desktop', () => { | ||
beforeEach(() => { | ||
cy.visit('/#/cypress/dark-mode'); | ||
}) | ||
|
||
it('should render the week view in dark mode', () => { | ||
cy.compareSnapshot('dark-mode-week-view'); | ||
}); | ||
|
||
it('should render the month view in dark mode', () => { | ||
setMonthMode(); | ||
cy.compareSnapshot('dark-mode-month-view'); | ||
}); | ||
|
||
it('should render the day view in dark mode', () => { | ||
setDayMode(); | ||
cy.compareSnapshot('dark-mode-day-view'); | ||
}) | ||
}); | ||
|
||
|
||
describe('Dark mode on mobile', () => { | ||
beforeEach(() => { | ||
cy.viewport('iphone-6'); | ||
cy.visit('/#/cypress/dark-mode'); | ||
}) | ||
|
||
it('should render the month view in dark mode', () => { | ||
setMonthMode(); | ||
cy.compareSnapshot('dark-mode-month-view-mobile'); | ||
}); | ||
|
||
it('should render the day view in dark mode', () => { | ||
setDayMode(); | ||
cy.compareSnapshot('dark-mode-day-view-mobile'); | ||
}) | ||
}); |
Binary file added
BIN
+38.3 KB
cypress/snapshots/linux/base/13-dark-mode.cy.ts/dark-mode-day-view-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.4 KB
cypress/snapshots/linux/base/13-dark-mode.cy.ts/dark-mode-day-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56 KB
cypress/snapshots/linux/base/13-dark-mode.cy.ts/dark-mode-month-view-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+219 KB
cypress/snapshots/linux/base/13-dark-mode.cy.ts/dark-mode-month-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+131 KB
cypress/snapshots/linux/base/13-dark-mode.cy.ts/dark-mode-week-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.6 KB
cypress/snapshots/mac/base/13-dark-mode.cy.ts/dark-mode-day-view-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70.8 KB
cypress/snapshots/mac/base/13-dark-mode.cy.ts/dark-mode-month-view-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+280 KB
cypress/snapshots/mac/base/13-dark-mode.cy.ts/dark-mode-month-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<template> | ||
<div class="page" style="color-scheme: dark"> | ||
<div class="wrapper"> | ||
<Qalendar | ||
:config="config" | ||
:selected-date="new Date(2022, (6 - 1), 16)" | ||
:events="events" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import {defineComponent} from "vue"; | ||
import Qalendar from '../../src/Qalendar.vue'; | ||
import {fiveDayWeekEvents} from './__data__/02-five-day-week'; | ||
import {configInterface} from '../../src/typings/config.interface'; | ||
import {WEEK_START_DAY} from "../../src/helpers/Time"; | ||
export default defineComponent({ | ||
name: 'DarkMode', | ||
components: {Qalendar}, | ||
data() { | ||
return { | ||
config: { | ||
locale: 'de-DE', | ||
week: { | ||
startsOn: WEEK_START_DAY.MONDAY, | ||
}, | ||
} as configInterface, | ||
events: [], | ||
} | ||
}, | ||
mounted() { | ||
this.events = fiveDayWeekEvents; | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.page { | ||
width: 100%; | ||
background-color: #000; | ||
} | ||
.wrapper { | ||
margin-top: 24px; | ||
max-width: 1400px; | ||
height: 1000px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.