material-ui

Using material ui createStyles

限于喜欢 提交于 2019-12-02 11:40:22
问题 I'm trying to transform my css from a less file to material createStyles and i can't get my head around how it works. I understand the basics of the createstyles but i can't my child selector working All i want is to be able to access the css class missionStatusLibelle .missionStatus { display: flex; align-items: center; height: 34px; width: 100%; .missionStatusLibelle { align-items: flex-start; justify-content: flex-start; margin-left: 10px; font-size: 14px; font-weight: 500; line-height:

material ui Tabs unclickable

China☆狼群 提交于 2019-12-02 11:20:34
Tabs from material-ui are unclickable. Nothing happens then i click on them. Code is just simple: `var Tabs = React.createClass ({ render: function() { return ( <Tabs> <Tab label="1"> <p>hello 1</p> </Tab> <Tab label="2"/> <p>hello 2</p> </Tab> </Tabs> ); } });` But on the page i see theese tabs with first tab opened and then i click on the second nothing happens. Tried different browsers. What could go wrong? You must add this code: var injectTapEventPlugin = require("react-tap-event-plugin"); injectTapEventPlugin(); I wonder why it is not explicitly mentioned in their examples. 来源: https:/

how to use css in JS for nested hover styles, Material UI

≡放荡痞女 提交于 2019-12-02 09:56:00
问题 I'm using Material UI and trying to convert normal css classes into js file. .nav { list-style-type: none; margin: 0; padding: 0; overflow: hidden; } .navItem { float: left; flex: 1; } .navLink { color: white; text-decoration: none; display: block; font-size: '1 rem'; font-weight: 500; line-height: 1.6; letter-spacing: '0.0075em'; opacity: 1; text-transform: 'none'; min-width: 0; padding: 10px; margin-left: 10px; margin-right: 10px; } .navLink-static { color: white; text-decoration: none;

map method iteration in stepper for material ui

孤街浪徒 提交于 2019-12-02 09:34:17
I am trying to add the redux form inside my stepper. but the problem is if I add form fields inside its reflecting in all the three places. so I started debugging the stepper code. found that they are iterating in map method. so I thought on basis of putting if condition for label I will show the div and form tags. but its not working. can you tell me how to fix it. so that in future I will fix it myself. providing my code snippet and sandbox below https://codesandbox.io/s/y2kjpl343z return ( <div className={classes.root}> <Stepper activeStep={activeStep} orientation="vertical"> {steps.map(

Specifing a hover border color on a textfield using a custom theme with Material UI

一世执手 提交于 2019-12-02 07:43:16
Having trouble finding documentation on how to change the default border color of an outlined Textfield on hover using a custom theme on Material ui. MuiOutlinedInput: { root: { "&:hover:not($disabled):not($focused):not($error) $notchedOutline": { border: "2px solid", borderColor: "yellow" } } } Reference Example 来源: https://stackoverflow.com/questions/52916042/specifing-a-hover-border-color-on-a-textfield-using-a-custom-theme-with-material

Selenide test fails to interact with Material`s checkbox

烂漫一生 提交于 2019-12-02 07:42:25
Dear stackoverflowers. We are using Selenide framework in our project to write automation tests for UI. We switched to Material-UI recently and faced with technical problems when it comes to simple checkbox . I am trying to select checkbox. SelenideElement rememberMeCheckBox = $(By.cssSelector("input[type=\"checkbox\"]")); rememberMeCheckBox.setSelected(isSelected); But while doing that I get an exception: Element should be visible {input[type="checkbox"]} Element: '<input type="checkbox" value="on" displayed:false></input>' And indeed when I check the real DOM it contains opacity: 0 : When I

Send Variable to withStyles in Material UI?

匆匆过客 提交于 2019-12-02 07:42:11
问题 I have the following: class StyledInput extends React.Component{ styles = (color, theme) => ({ underline: { borderBottom: `2px solid ${color}`, '&:after': { borderBottom: `2px solid ${color}`, } } }) div = props => ( <TextField placeholder="temp input" InputProps={{ classes:{ root: props.classes.underline }, style:{ height: '1.5rem', fontSize:'1rem', marginTop: '-1rem', } }} > <div> {props.children} </div> </TextField> ) Styled = withStyles(this.styles('white'))(this.div) render(){ return(

Can't change border color of Material-UI OutlinedInput

坚强是说给别人听的谎言 提交于 2019-12-02 07:40:36
问题 I'm trying to change the border color of a v4.13 MaterialUI Outlined Input. However I have not gotten anything to work when trying to override the CSS. I've tried multiple CSS rules applied to each element, the select and the OutlinedInput, with the two below being the most recent. What am I doing wrong here? const styles = () => createStyles({ select: { "&:before": { borderColor: "red" }, "&:after": { borderColor: "red" }, }, outline: { "&:before": { borderColor: "red" }, "&:after": {

Adding component with material-table changes Material-UI AppBar style

爷,独闯天下 提交于 2019-12-02 07:09:26
问题 My app is using Material-UI and material-table. A global theme is applied in the "index.js" file using "ThemeProvider" with as a child and then has children: <Fragment> <CssBaseline /> <MenuAppBar /> <main className={classes.main}> <Route path="/" exact component={Home} /> <Route path="/login" component={Login}></Route> </main> </Fragment> The component then has the component with the material-table. When I add in the table component and view that page the AppBar looses some of it's styling,

I'm getting error after upgrading to Material UI 4 - withStyles

六月ゝ 毕业季﹏ 提交于 2019-12-02 07:00:28
问题 I'm getting the following error after upgrading to MUI v4.0.2 from v3.9.x: You must pass a component to the function returned by connect. Instead received {"propTypes":{},"displayName":"WithStyles(MyComponent)","options":{"defaultTheme":{"breakpoints":{"keys":["xs","sm","md","lg","xl"],"values": ... MyComponent: import { withStyles } from '@material-ui/core/styles' const getStyles = theme => ({ fooBar: { ... }, }) ... export default withStyles(getStyles)(MyComponent) MyContainer: import {