Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 样式化组件主题:使用主题值作为另一个值的一部分_Reactjs_Styled Components - Fatal编程技术网

Reactjs 样式化组件主题:使用主题值作为另一个值的一部分

Reactjs 样式化组件主题:使用主题值作为另一个值的一部分,reactjs,styled-components,Reactjs,Styled Components,我有一个theme.js,我想在另一个值上使用theme的一个值,我正在使用一个变量来重用这个值 # theme.js // I want to see if I can remove this var and use // theme.typography.body >> theme.typography.styles.label const BODY_FONT = "'Roboto', 'Franklin Gothic Medium', Tahoma, sans-se

我有一个theme.js,我想在另一个值上使用theme的一个值,我正在使用一个变量来重用这个值

# theme.js
// I want to see if I can remove this var and use
// theme.typography.body >> theme.typography.styles.label
const BODY_FONT =  "'Roboto', 'Franklin Gothic Medium', Tahoma, sans-serif";

const defaultTheme: DefaultTheme = {
  typography: {
    body: BODY_FONT,
    styles: {
      label: `font-family: ${BODY_FONT};font-size: 14x;line-height: 1;`,
    },
  },
}
我想看看是否可以删除BODY_字体并使用?
主题.排版.正文>>主题.排版.样式.标签