uni.scss文件
.theme-light {
--primaryColorbg3: #ffd6a3;
--baseColor: #FAF7F5;
}
index.uvue文件
<template>
<view class="login-container" :class="themeState.theme">
<!-- <button @click="change()">1111</button> -->
</view>
</template>
<script setup lang="uts">
import { themeState, setTheme } from '@/store/theme.uts'
const color = '#ffd6a3'
function change() {
setTheme(themeState.theme == 'theme-dark' ? 'theme-light' : 'theme-dark')
}
</script>
<style lang="scss">
.login-container {
width: 750rpx;
height: 1624rpx;
background-image: linear-gradient(180deg, var(--primaryColorbg3) -10%, var(--baseColor) 30%);
}
</style>
0 个回复