如何访问主题工具栏的断点属性?

时间:2020-11-10 05:29:40

标签: material-ui jss

我正在使用material-ui themeProvider并尝试以一种样式访问默认主题中的所有高度值:

makeStyles(theme => createStyles({
 ...
 marginTop: -theme.mixins.toolbar.minHeight, // works
 [`${theme.breakpoints.up('xs')} and (orientation: landscape)`]: {
   marginTop: -theme.mixins.toolbar.@media___????.minHeight },
  [theme.breakpoints.up('sm')]: { 
    marginTop: -theme.mixins.toolbar.@media___????.minHeight },

enter image description here

如何访问@media值?

1 个答案:

答案 0 :(得分:0)

与使用括号表示法访问对象属性相同

import json from locust import User, HttpUser, task, between, SequentialTaskSet, HttpLocust USER_CREDENTIALS = [ ("abc@xyz.com", "Yahoo@123"), ("xyz@xyz.com", "Yahh-69-Wrap") ] class CLMLoginTaskSet(SequentialTaskSet): hostname_app2 = "http://app2.stage.cloud.local" hostname_app1 = "http://app1.stage.cloud.local" port = "8090" username = "NOT_FOUND" password = "NOT_FOUND" access_token_value1 = None @task def userlist(self): if len(USER_CREDENTIALS) > 0: self.username, self.password = USER_CREDENTIALS.pop() @task def generate_clm_token(self): print("username", self.username) print("password", self.password) headers = {'Content-Type': 'application/x-www-form-urlencoded'} clm_response = self.client.post(self.hostname_app2+":"+self.port+"/oauth2/access? grant_type=password&username="+self.username+"&password="+self.password", headers=headers) print("CLM Response", clm_response.text) json_clm_response = clm_response.json() access_token_value = json_clm_response['access_token'] print("This is the access token value", access_token_value) self.access_token_value1 = access_token_value class CLMLogin(HttpUser): tasks = [CLMLoginTaskSet] host = "" wait_time = between(1, 2)