OneGraph / graphiql-explorer

Explorer plugin for GraphiQL
MIT License
904 stars 97 forks source link

use stylesheet instead of inline-CSS #9

Closed wawhal closed 5 years ago

wawhal commented 5 years ago

We are trying to integrate graphiql-explorer into Hasura GraphQL Engine console. We wish to override some CSS and are unable to do it because inline CSS has been used.

This PR adds a stylesheet in place of inline-CSS.

robinweser commented 5 years ago

Seems reasonable! But, just FYI, you can always overwrite inline style using the element[style] selector :p

wawhal commented 5 years ago

Sure @rofrischmann Can we merge this if it LGTY?

dwwoelfel commented 5 years ago

I'd like to keep Explorer.js as a self-contained file.

@wawhal Can you modify this so that the component takes an optional styles map and merges those with the default styles?

You can leave the class names in place. Then if someone wants to override the styles with classes, they can still do that (you'd just have to pass a styles map that nulls out all of the styles).

sgrove commented 5 years ago

We'll be shooting for style objects as a way of introducing theming, will close this and revisit once we have support for it!

sgrove commented 4 years ago

@wawhal @coco98 Does https://github.com/OneGraph/graphiql-explorer#customizing-styles handle what you need now?

wawhal commented 4 years ago

@sgrove this is awesome! Solves all our problems. Thanks. It is already being integrated in the Hasura console. You can track it here: https://github.com/hasura/graphql-engine/pull/2994