4

From the docs of react-table it is stated that:

We think the default styles looks great! But, if you prefer a more custom look, all of the included styles are easily overridable. Every single component contains a unique class that makes it super easy to customize. Just go for it!

I tried overriding a className of .ReactTable .-pagination .-pageSizeOptions as seen here: enter image description here

.ReactTable .-pagination .-pageSizeOptions {
  visibility: hidden;
  margin: 3px 10px;
  position: absolute;
}

But it has no effect? but if i do that on inspect element, it's working, I am importing my overrides on the root index.js, tried it on the file, no effetct.

require('./react-table-overrides.css');

const client = new ApolloClient({
  link: new HttpLink({ uri: '/graphql' }),
  cache: new InMemoryCache(),
});

ReactDOM.render(
  <ApolloProvider client={client}>
    <App />
  </ApolloProvider>,
  document.getElementById('root'),
);

Help?

2
  • Is this file in memory react-table-overrides.css before inspecting ? Commented Jan 26, 2018 at 8:19
  • @rach8garg i imported it on public/index.html, I have problems importing it in node :/ Commented Jan 26, 2018 at 13:17

1 Answer 1

2

Try using css modules and :global, it's works for me

:global div.pagination-bottom > div > div.-center > span.select-wrap.-pageSizeOptions {
  visibility: hidden !important;
  margin: 3px 10px !important;
  position: absolute !important;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.