是否可以在 JSS 中创建一个变量,例如 Sass

Is it possible to make a variable in JSS like Sass

我正在做一个 React 项目。对于样式,我使用 Material-ui 和 JSS。在 Sass 中,我们可以创建变量并在以后像这样 $color: rgb(255, 255, 255, 255) 使用它。 我想在 JSS 中使用像 Sass 这样的变量。是否有可能做到这一点?

只需创建一个javascript变量

const color = 'rgb(255, 255, 255, 255)';

const style = {
    button: {
        color: color
    },
};