Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Add support for dark mode #3

Open
transitive-bullshit opened this issue Feb 16, 2021 · 2 comments
Open

Add support for dark mode #3

transitive-bullshit opened this issue Feb 16, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@transitive-bullshit
Copy link
Owner

Just need to port this over and add it to the demo.

@transitive-bullshit transitive-bullshit added the enhancement New feature or request label Feb 16, 2021
@DaniGuardiola
Copy link

Working on this.

For future reference, this seems to be the place where the dark styles are in the original project: https://github.com/lfades/static-tweet/blob/3105e53bce14fa9a8dd004fb9cd66732069c29c9/components/dark-layout/dark.module.css

@leerob
Copy link

leerob commented Dec 27, 2022

I was able to make this work with CSS variables, might be worth adding to the README. This is with Tailwind CSS specifically:

@import 'react-static-tweets/styles.css';

.static-tweet {
  margin: 40px auto;
  --tweet-bg-color: theme('colors.white');
  --tweet-font-color: theme('colors.black');
  --tweet-color-gray: theme('colors.neutral.500');
  --tweet-border: 1px solid theme('colors.neutral.200');
  --tweet-border-hover: 1px solid theme('colors.neutral.300');
}

.static-tweet-header-name {
  color: theme('colors.black');
}

@media (prefers-color-scheme: dark) {
  .static-tweet {
    --tweet-bg-color: theme('colors.neutral.900');
    --tweet-font-color: theme('colors.white');
    --tweet-color-gray: theme('colors.neutral.400');
    --tweet-border: 1px solid theme('colors.neutral.800');
    --tweet-border-hover: 1px solid theme('colors.neutral.700');
  }

  .static-tweet-header-name {
    color: theme('colors.white');
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants