大多数项目通过分叉@pancakeswap-libs node_module 来改变主题。
如果您查看 uikit/dist 文件夹,则会有一个名为 index.esm.js 的文件。
大多数浅色和深色主题的样式都在第 2774 - 2791 行,看起来像这样。
var baseColors = {
failure: "#ED4B9E",
primary: "#537f91",
primaryBright: "#537f91",
primaryDark: "#537f91",
secondary: "#787878",
success: "#31D0AA",
warning: "#FFB237",
var lightColors = __assign(__assign(__assign({}, baseColors), brandColors), { background: "#FAF9FA", backgroundDisabled: "#E9EAEB", contrast: "#191326", invertedContrast: "#c1dec0", input: "#eeeaf4", tertiary: "#EFF4F5", text: "#537f91", textDisabled: "#BDC2C4", textSubtle: "#537f91", borderColor: "#E9EAEB", card: "#FFFFFF", gradients: {
bubblegum: "linear-gradient(139.73deg, #E6FDFF 0%, #F3EFFF 100%)",
} });
var darkColors = __assign(__assign(__assign({}, baseColors), brandColors), { secondary: "#FFFFFF", background: "#343135", backgroundDisabled: "#3c3742", contrast: "#FFFFFF", invertedContrast: "#191326", input: "#483f5a", primaryDark: "#0098A1", tertiary: "#353547", text: "#ffff", textDisabled: "#666171", textSubtle: "#ffff", borderColor: "#524B63", card: "#27262c", gradients: {
bubblegum: "linear-gradient(139.73deg, #313D5C 0%, #3D2A54 100%)",
} });
我在第 1746 行发现了另一个颜色变量。
这是另一个项目如何将他们的分叉 node_module 添加到他们的 package.json 文件的示例。
"dependencies": {
"@binance-chain/bsc-use-wallet": "^0.8.1",
"@craco/craco": "^6.1.1",
"@crowdin/crowdin-api-client": "^1.10.1",
"@ethersproject/abi": "^5.0.7",
"@pancakeswap-libs/uikit": "veganswap-defi/vegan-uikit",
"@reduxjs/toolkit": "^1.5.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.5",
这是该仓库的链接https://github.com/veganswap-defi/vegan-frontend-farms/blob/master/package.json