gerhardsletten / react-reader

An ePub-reader for React, powered by Epub.js
https://react-reader.metabits.no
Apache License 2.0
721 stars 132 forks source link

Overwrite react-reader default styles #141

Closed avalero closed 1 year ago

avalero commented 1 year ago

On documentation says that the way to overwrite the styles is:

const ownStyles = {
  ...ReactReaderStyle,
  arrow: {
    ...ReactReaderStyle.arrow,
    color: 'red'
  }
}

const App = () => {
  return (
    <div style={{ height: '100vh' }} className="myReader">
      <ReactReader
        url="https://react-reader.metabits.no/files/alice.epub"
        readerStyles={ownStyles}
      />
    </div>
  )
}

But ReactReaderStyle is a type, not a value. In order to make this I think you should export on the package reactReaderStyles on src/modules/ReactReader.style.js

Thanks for your work

gerhardsletten commented 1 year ago

@avalero Should probably rewrite the whole package to TS soon, but did the updated in react-reader@1.2.0 work for you now?

AjayManikantaG commented 1 year ago

@gerhardsletten Could you please let me know for any workaround for now to change styles as needed?

Thanks, Ajay

gerhardsletten commented 1 year ago

@AjayManikantaG Sorry, but it should be fixed in react-reader@1.2.1 #144

avalero commented 1 year ago

Thanks, withreact-reader@1.2.0 it works