old-ybbond

My old site that was written with ReactJS
Log | Files | Refs | README | LICENSE | CC-LICENSE

Style.js (449B)


      1 // @flow
      2 import React from 'react';
      3 import {createGlobalStyle} from 'styled-components';
      4 import {colors} from './colors';
      5 
      6 type Props = {
      7   dark: boolean,
      8 };
      9 
     10 const Style = createGlobalStyle`
     11   html {
     12       background-color: ${props => (props.dark ? colors.dark : colors.light)};
     13   }
     14   &::selection {
     15     background-color: ${props =>
     16       props.dark ? colors.darkSelection : colors.lightSelection};
     17   }
     18 `;
     19 
     20 export default React.memo<Props>(Style);