-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/dark theme #200
Feature/dark theme #200
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@@ -120,7 +122,9 @@ export class GraphiQL extends React.Component { | |||
onEditVariables: PropTypes.func, | |||
onEditOperationName: PropTypes.func, | |||
onToggleDocs: PropTypes.func, | |||
getDefaultFieldNames: PropTypes.func | |||
getDefaultFieldNames: PropTypes.func, | |||
theme: PropTypes.oneOf([ 'dark' ]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured we could keep this open to future theme(s)
Could this be done in a simpler way? For example, if there are more themes in the future - this sets a precedent that they can only be added by PR to this repo. Ideally anyone can write and share their own themes and host them in whatever repo they like. What do we need to do for GraphiQL to enable that? Are the CSS class names descriptive enough that the only necessary thing is to just add another CSS file to the page? Do we need the ability to set an additional classname on the GraphiQL root node? |
I think it's easy enough to add your own body/html class and overwrite the current theme via css selector specificity. I've already done this myself in a few implementations. We could also expose an optional My final thought is that colors and other backgrounds are defined in numerous places, so theming can be kind of painful since you have to overwrite numerous selectors. This begs for either refactoring the css to make theming easier, or implement some preprocessor so consumers can overwrite variables and generate the css themselves. |
I'm going to close this PR and work on another branch that more descriptively shows how to theme, and offers a |
Hrm, doing some digging on color definitions:
Dropping the |
i would be interested in this |
And another year later |
And two more years later... |
@joelgriffith did you ever re-open this PR? this accidentally was cross referenced when merging other repos |
Super hot dark theme, super slick css, all in one nice PR: