splitbee / react-notion

A fast React renderer for Notion pages
https://react-notion.com
MIT License
2.85k stars 149 forks source link

Is it possible to style for dark mode? #115

Closed jeanmw closed 1 year ago

jeanmw commented 1 year ago

Is it possible to use custom styles like dark mode ? I'm using tailwind, but I've tried using a style property as well.

import React from 'react';
import PropTypes from 'prop-types';
import { css, styled } from 'twin.macro';

const styles = css`
.dark-mode {
  .notion, .notion-text, .notion-page-link {
    color: white;
  }
}`;

const StyledDiv = styled.div(() => [styles]);
...
  return (
<StyledDiv>
    <NotionRenderer blockMap={recordMap.data} />
</StyedDiv>
  );

This doesn't seem to work:

Screen Shot 2023-03-07 at 4 10 07 PM

Is there an alternative besides forking this repo and fixing the styles in the fork?