material-ui

Simple selector and nested selector in JSS

半腔热情 提交于 2020-05-15 02:47:12
问题 I'm currently training on ReactJS. I'm using material-ui and JSS (totally new for me). I don't understand how can I simply select my H6 element or my H6 children elements (dangerStyle). Any idea ? Thanks ! myJss.js const myJss = theme => ({ textCenter : { textAlign:'center' }, dangerStyle: { fontWeight:'normal', color:"#FF0000" }, h6: { color:"#00FF00", "&.dangerStyle" : { fontWeight:'bold', } } }); export default myJss; app.js import React, { Component } from 'react' import { withStyles }

Simple selector and nested selector in JSS

丶灬走出姿态 提交于 2020-05-15 02:46:26
问题 I'm currently training on ReactJS. I'm using material-ui and JSS (totally new for me). I don't understand how can I simply select my H6 element or my H6 children elements (dangerStyle). Any idea ? Thanks ! myJss.js const myJss = theme => ({ textCenter : { textAlign:'center' }, dangerStyle: { fontWeight:'normal', color:"#FF0000" }, h6: { color:"#00FF00", "&.dangerStyle" : { fontWeight:'bold', } } }); export default myJss; app.js import React, { Component } from 'react' import { withStyles }

How to disable ripple in Material Design React

三世轮回 提交于 2020-05-14 19:09:38
问题 I am talking about this repository. https://github.com/callemall/material-ui I want to know how to disable the ripple effect from all components. Thanks. 回答1: You can disable the default property by adding this to componentDidMount() at the highest level React component that is inside of the MUIThemeProvider : componentDidMount(){ //Do this to all components you would like to disable the ripple effect. EnhancedButton.defaultProps.disableTouchRipple = true; EnhancedButton.defaultProps

How to disable ripple in Material Design React

天大地大妈咪最大 提交于 2020-05-14 19:08:34
问题 I am talking about this repository. https://github.com/callemall/material-ui I want to know how to disable the ripple effect from all components. Thanks. 回答1: You can disable the default property by adding this to componentDidMount() at the highest level React component that is inside of the MUIThemeProvider : componentDidMount(){ //Do this to all components you would like to disable the ripple effect. EnhancedButton.defaultProps.disableTouchRipple = true; EnhancedButton.defaultProps

How to convert CSS with properties to MaterialUI Styles in ReactJS

旧时模样 提交于 2020-05-14 18:42:05
问题 I have the following CSS: [contentEditable=true]:empty:not(:focus):before{ content:attr(data-text) } which allows to show a placeholder inside a content-editable div when it has no content. I am using Material-UI Styles, so I need something like: const styles = theme => ({ div[contentEditable=true]:empty:not(:focus):before: { content:attr(data-text) } }); How could I achieve this? Any idea? Thank you. 回答1: Below are a couple syntax options depending on whether you want to specify the class

Material UI TextField Custom Attribute

北慕城南 提交于 2020-05-14 18:30:11
问题 I am currently trying to set a custom data attribute to a TextField component as such: class TestTextField extends React.Component { componentDidMount() {console.log(this._input)} render() { return ( <TextField label="Label 1" InputProps={{placeholder: 'Input 1', 'data-state': 'Data State 1'}} margin="normal" inputRef={(elem) => {this._input = elem}} /> ) } } However I can't get data-state to show up with the console log saying <textarea rows="1" class="MuiTextarea-textarea-67 MuiInput-input

React How to conditionally override TextField error color in Material-UI?

我们两清 提交于 2020-05-13 14:16:52
问题 I'm using React Material-UI library and I want to conditionally override the error color of a TextField. I need to change the helperText, border, text and required marker color to yellow when the error is of a certain type. Something like that : Otherwise, I want to keep the default color(red) for every other type of error. I tried to follow the same principle used in this codesandbox but I couldn't get a grip of all the components that I needed to change and I had to use the important

CKEditor 4 having problem when used in Material UI dialog

那年仲夏 提交于 2020-05-13 11:31:17
问题 I am working on a React project where I have used CKEditor 4 on Material UI dialog. When I am trying to use advance options like Math. I am not able to type in, anything on input, textarea fields. I have searched for solutions but all the solutions are with respect to Bootstrap Modal. If anyone has faced the same issue using the Material UI dialog. It will be a great help if you can share the solution. Solution for Bootstrap Modal: http://stackoverflow.com/a/18554395/778587 Material UI dialog

CKEditor 4 having problem when used in Material UI dialog

时光怂恿深爱的人放手 提交于 2020-05-13 11:28:46
问题 I am working on a React project where I have used CKEditor 4 on Material UI dialog. When I am trying to use advance options like Math. I am not able to type in, anything on input, textarea fields. I have searched for solutions but all the solutions are with respect to Bootstrap Modal. If anyone has faced the same issue using the Material UI dialog. It will be a great help if you can share the solution. Solution for Bootstrap Modal: http://stackoverflow.com/a/18554395/778587 Material UI dialog

CKEditor 4 having problem when used in Material UI dialog

泪湿孤枕 提交于 2020-05-13 11:27:59
问题 I am working on a React project where I have used CKEditor 4 on Material UI dialog. When I am trying to use advance options like Math. I am not able to type in, anything on input, textarea fields. I have searched for solutions but all the solutions are with respect to Bootstrap Modal. If anyone has faced the same issue using the Material UI dialog. It will be a great help if you can share the solution. Solution for Bootstrap Modal: http://stackoverflow.com/a/18554395/778587 Material UI dialog