jss

How to override styles for material-ui TextField component without using the MUIThemeProvider?

*爱你&永不变心* 提交于 2019-12-07 12:18:23
问题 How would I hide / remove the underline in a TextField component without using the following code: const theme = createMuiTheme({ overrides: { MuiInput: { underline: { '&:hover:not($disabled):before': { backgroundColor: 'rgba(0, 188, 212, 0.7)', }, }, }, }, }); I would like to do it with props and according to the docs: https://material-ui.com/api/input/ I should be able to change the underline prop, but it does not work. 回答1: This is how you do it: <TextField id="name" label="Name" value=

Material-UI Style Override?

允我心安 提交于 2019-12-07 06:38:27
问题 I'm updating my app from Material-UI v1 to v2. I'm trying to use a style override to set the color of a selected <BottomNavigationAction> element. const styles = { bottomNavStyle: { position: 'fixed', left: '0px', bottom: '0px', height: '50px', width: '100%', zIndex: '100' }, '&$selected': { color: "#00bcd4" //<==trying to add this color to selected items }, }; class bottom_nav extends Component { state = { selectedIndex: -1, }; handleChange = (event, value) => { this.setState({value}); };

How to use react-jss with MaterialUI 4?

只愿长相守 提交于 2019-12-06 15:48:57
I've used react-jss with material-ui for a while now. The material-ui 3.x -> 4.x migration guide says that MUI 4 isn't compatible with React JSS 9.x: https://material-ui.com/guides/migration-v3/ Furthermore, it looks like the react-jss project has been archived: https://github.com/cssinjs/react-jss ...but JSS is up to at least version 10: https://cssinjs.org/?v=v10.0.0-alpha.16 So I'm completely confused on how to use React-JSS with MUI 4. Is the import something other than "react-jss": "8.6.1", in package.json ? Should I switch to Emotion or Styled Components? So confused. You can use: "react

How to mount styles inside shadow root using cssinjs/jss

早过忘川 提交于 2019-12-06 13:52:27
I'm trying to use https://material-ui.com/ components inside shadow dom, and need a way to inject those styles inside shadow dom. by default material-ui , which uses jss under the hood injects styles in the head of the page. Is that even possible? Can anyone come with an example? This is what my web component looks like, it is a web component that renders a react app that contains material-ui styles. import * as React from 'react'; import { render } from 'react-dom'; import { StylesProvider, jssPreset } from '@material-ui/styles'; import { create } from 'jss'; import { App } from '@myApp/core'

How to override styles for material-ui TextField component without using the MUIThemeProvider?

跟風遠走 提交于 2019-12-05 22:47:25
How would I hide / remove the underline in a TextField component without using the following code: const theme = createMuiTheme({ overrides: { MuiInput: { underline: { '&:hover:not($disabled):before': { backgroundColor: 'rgba(0, 188, 212, 0.7)', }, }, }, }, }); I would like to do it with props and according to the docs: https://material-ui.com/api/input/ I should be able to change the underline prop, but it does not work. This is how you do it: <TextField id="name" label="Name" value={this.state.name} margin="normal" InputProps={{disableUnderline: true}} /> How did I figure it out? You have

How to override material-ui MenuItem selected background color?

醉酒当歌 提交于 2019-12-05 18:39:25
Currently I am struggling with setting the background color of a MenuItem component which is selected to a different color. (without having to using !important to force it) The component code: <MenuItem classes={{ root: this.props.classes.root, selected: this.props.classes.selected }} value={10}> Alfabetical </MenuItem> This is the css: const homePageStyle = (theme) => ({ root: { width: "300px" }, selected: { backgroundColor: "turquoise !important", color: "white", fontWeight: 600 } }); What do I want to achieve? I would like to set the backgroundColor of the MenuItem without having to set the

Material-UI Style Override?

两盒软妹~` 提交于 2019-12-05 13:17:23
I'm updating my app from Material-UI v1 to v2. I'm trying to use a style override to set the color of a selected <BottomNavigationAction> element. const styles = { bottomNavStyle: { position: 'fixed', left: '0px', bottom: '0px', height: '50px', width: '100%', zIndex: '100' }, '&$selected': { color: "#00bcd4" //<==trying to add this color to selected items }, }; class bottom_nav extends Component { state = { selectedIndex: -1, }; handleChange = (event, value) => { this.setState({value}); }; render() { const { classes } = this.props; return ( <Paper className={classes.bottomNavStyle}>

作业3

守給你的承諾、 提交于 2019-12-04 04:55:55
## 一、编写一个程序读取输入,读到#字符停止,然后报告读取的空格数、换行符数和所有其他字符的数量。 #include<iostream> using namespace std; int main() { char x; int a=0; int b=0; int c=0; while((x=getchar())!= '#') { if(x == ' ') a++; else if(x == '\n') b++; else { c++; } } cout << a <<" "<< b << " "<< c; return 0; } 二、编写一个程序读取输入,读到#字符停止。程序要打印每个输入的字符以及对应的ASCII码(十进制)。一行打印8个字符。建议:使用字符计数和求模运算符(%)在每8个循环周期时打印一个换行符。 #include <stdio.h> //#define STOP '#' int main(void) { char c; int n = 0; while((c = getchar()) != '#') { if (c == '\n') continue; printf("%2c:%-7d", c, c); n++; } return 0; } 三、编写一个程序,读取整数直到用户输入 0。输入结束后,程序应报告用户输入的偶数(不包括 0)个数、这些偶数的平均值

Number input spin box CSS code compiler to JSS

假如想象 提交于 2019-12-02 08:02:32
I've got problem with converting CSS code for hiding spin box of number input for JSS . My question is how to appropriately convert this code that it will match JSS? input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input[type=number] { -moz-appearance:textfield; } input: { '&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': { '-webkit-appearance': 'none', '-moz-appearance': 'none', 'margin': 0 }, '&[type=number]': { '-webkit-appearance': 'textfield', '-moz-appearance': 'textfield' } } This should work. 来源: https:/

material-ui jss-rtl - after using jss-rtl my page is still LTR

若如初见. 提交于 2019-12-01 09:27:18
I'm using material-ui and next and jss-rtl in my react project but there is a problem the page is still ltr after using <JssProvider ...> -rtl component code: import React from "react"; import { create } from 'jss'; import rtl from 'jss-rtl'; import JssProvider from 'react-jss/lib/JssProvider'; import { createGenerateClassName, jssPreset } from 'material-ui/styles'; // Configure JSS const jss = create({ plugins: [...jssPreset().plugins, rtl()] }); // Custom Material-UI class name generator. const generateClassName = createGenerateClassName(); function RTL(props) { return ( <JssProvider jss=