Skip to content
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

Refactor nteract CSS for CodeMirror #1480

Closed
rgbkrk opened this issue Feb 17, 2017 · 2 comments
Closed

Refactor nteract CSS for CodeMirror #1480

rgbkrk opened this issue Feb 17, 2017 · 2 comments

Comments

@rgbkrk
Copy link
Member

rgbkrk commented Feb 17, 2017

We need to rethink our current CSS styling of CodeMirror. Right now it depends on a particular DOM structure and makes our theming less flexible. In an ideal state I'd be able to use our CSS with a runMode version of codemirror like this (see #1454 (comment)):

// Wish I could use this, we need to fix up 
export class StaticCodeMirror extends React.Component {
  props: Props;
  el: HTMLElement;

  componentDidMount(): void {
    console.log(this.props);
    CM.runMode(this.props.text, this.props.mode, this.el);
  }

  shouldComponentUpdate(nextProps: Props): boolean {
    return nextProps.text !== this.props.text || this.props.mode !== nextProps.mode;
  }

  componentDidUpdate(): void {
    console.log('update');
    CM.runMode(this.props.text, this.props.mode, this.el);
  }

  render(): ?React.Element<any> {
    return (
      <div className="input">
        <div className="cell_cm cm-s-composition">
          <pre className="CodeMirror-lines" ref={(el) => { this.el = el; }} />
        </div>
      </div>
    );
  }
}
@rgbkrk
Copy link
Member Author

rgbkrk commented Dec 17, 2017

This was addressed with our adoption of styled-jsx and bringing the codemirror styles in.

@rgbkrk rgbkrk closed this as completed Dec 17, 2017
@lock
Copy link

lock bot commented Apr 16, 2018

Howdy! I'm 🔓🤖!

In order to keep information timely (based on the most recent release), we want all activity to be added to either new issues or open issues and PRs. In service to that goal, I, the lock bot close inactive closed issues when they haven't had activity in 120 days.

Feel free to open a new issue for related bugs and link to relevant comments from this thread.

@lock lock bot locked and limited conversation to collaborators Apr 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant