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

feat: Dark mode API and config, fix #388 (#438 #438

Merged
merged 2 commits into from
Feb 8, 2023
Merged

Conversation

Akryum
Copy link
Member

@Akryum Akryum commented Feb 8, 2023

Fix #388

New configuration options:

export default defineConfig({
  theme: {
    defaultColorScheme: 'light',
    hideColorSchemeSwitch: true,
    storeColorScheme: false,
  },
})

New client API:

import { isDark, toggleDark } from 'histoire/client'

if (isDark()) {
  // do something only in dark mode
}

toggleDark()
toggleDark(true)

@codesandbox
Copy link

codesandbox bot commented Feb 8, 2023

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@stackblitz
Copy link

stackblitz bot commented Feb 8, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Feb 8, 2023

Deploy Preview for histoire-examples-svelte3 ready!

Name Link
🔨 Latest commit 153c096
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-svelte3/deploys/63e40653150fba0008b01aff
😎 Deploy Preview https://deploy-preview-438--histoire-examples-svelte3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 8, 2023

Deploy Preview for histoire-controls ready!

Name Link
🔨 Latest commit 153c096
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/63e40653d3c8530008b6cd9d
😎 Deploy Preview https://deploy-preview-438--histoire-controls.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 8, 2023

Deploy Preview for histoire-site ready!

Name Link
🔨 Latest commit 153c096
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/63e406535db86f0008ce49c1
😎 Deploy Preview https://deploy-preview-438--histoire-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 8, 2023

Deploy Preview for histoire-examples-vue3 ready!

Name Link
🔨 Latest commit 153c096
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/63e4065371ed170008027042
😎 Deploy Preview https://deploy-preview-438--histoire-examples-vue3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@Akryum Akryum changed the title feat: Dark mode API and config, fix #388 feat: Dark mode API and config, fix #388 (#438 Feb 8, 2023
@Akryum Akryum merged commit 683e6ba into main Feb 8, 2023
@Akryum Akryum deleted the feat/color-schema-api branch February 8, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External control for dark mode
1 participant