Reactjs 样式化组件主题:使用主题值作为另一个值的一部分
我有一个theme.js,我想在另一个值上使用theme的一个值,我正在使用一个变量来重用这个值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
// 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_字体并使用?
主题.排版.正文>>主题.排版.样式.标签