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

Strange styling in electron #33

Open
radhewro opened this issue Mar 6, 2017 · 2 comments
Open

Strange styling in electron #33

radhewro opened this issue Mar 6, 2017 · 2 comments

Comments

@radhewro
Copy link

radhewro commented Mar 6, 2017

Hi,

something looks strange after using react-toolbox-themr in electron. This should be a Button, an Input and a Navigation panel:

screen shot 2017-03-06 at 21 14 58

App.js code:

import theme from './assets/react-toolbox/theme'
import ThemeProvider from 'react-toolbox/lib/ThemeProvider'
import ReactDOM from 'react-dom'
import React from 'react'

import Button from 'react-toolbox/lib/button/Button'
import Navigation from 'react-toolbox/lib/navigation/Navigation';
import Link from 'react-toolbox/lib/link/Link';
import Input from 'react-toolbox/lib/input/Input';

// Render shell
ReactDOM.render(
  <ThemeProvider theme={theme}>
    <div>
      <Button label="Hello world!" raised primary />
      <Input type='email' label='Email address' icon='email' />
      <Navigation type='vertical'>
        <Link href='http://' label='Inbox' icon='inbox' />
        <Link href='http://' active label='Profile' icon='person' />
      </Navigation>
    </div>
  </ThemeProvider>,
  document.getElementById('container')
);

Compiled with babel (presets: es2015, react).

I've tested test-toolbox.tar.gz in browser too (modified to get a Button and an input field) and the problem still exists:

screen shot 2017-03-06 at 21 15 01

Web.app.js code:

import React, { Component } from 'react';
import './App.css';

import Input from 'react-toolbox/lib/input';
import Slider from 'react-toolbox/lib/slider';
import Button from 'react-toolbox/lib/button/Button';
import Snackbar from 'react-toolbox/lib/snackbar/Snackbar';

class SnackbarTest extends React.Component {
  handleClick = () => {
    this.refs.snackbar.show();
  };

  handleSnackbarClick = () => {
    this.refs.snackbar.hide();
  };

  render () {
    return (
      <section>
        <Button label='Show Snackbar' primary raised onClick={this.handleClick} />
        <Input label='Hello' />
        <Input type='email' label='Email address' icon='email' />
      </section>
    );
  }
}

class App extends Component {
  render() {
    return (
      <div className="App">
        <section>
        	<SnackbarTest />
        </section>
      </div>
    );
  }
}

What I'm doing wrong?

@anri-asaturov
Copy link
Contributor

anri-asaturov commented Mar 9, 2017

I had the same in my electron project, i found that the reason is this style i have:

* {
  font-family: "Open Sans", sans-serif;
}

It overrides material-icons font

@FDiskas
Copy link

FDiskas commented Mar 14, 2017

Got same problem but its still posible to fix that react-toolbox/react-toolbox#1321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants