fix: use frappe-ui theme colors and fixed tailwind config

This commit is contained in:
Jannat Patel
2025-12-08 10:37:31 +05:30
parent 5825bcf9b3
commit 040d74c20a
5 changed files with 16 additions and 13 deletions

View File

@@ -21,7 +21,10 @@
:style="
modelValue
? {
backgroundColor: getColor(modelValue.toLowerCase(), 400)
backgroundColor: getColor(
modelValue.toLowerCase(),
400
),
}
: {}
"
@@ -54,8 +57,7 @@
:key="color"
class="size-5 rounded-full cursor-pointer"
:style="{
backgroundColor:
getColor(color.toLowerCase(), 400),
backgroundColor: getColor(color.toLowerCase(), 400),
}"
@click="
(e) => {
@@ -104,5 +106,4 @@ const colors = computed(() => {
'Yellow',
]
})
</script>

View File

@@ -152,7 +152,8 @@ const props = defineProps({
})
const getGradientColor = () => {
let theme = localStorage.getItem('theme') == "light" ? "lightMode": "darkMode"
let theme =
localStorage.getItem('theme') == 'light' ? 'lightMode' : 'darkMode'
let color = props.course.card_gradient?.toLowerCase() || 'blue'
let colorMap = colors[theme][color]
return `linear-gradient(to top right, black, ${colorMap[400]})`

View File

@@ -81,11 +81,11 @@ const chartOptions = computed(() => {
enableShades: true,
colorScale: {
ranges: [
{ from: 0, to: 0, color: getColor("green", 400) },
{ from: 1, to: 5, color: getColor("green", 200) },
{ from: 6, to: 15, color: getColor("green", 500) },
{ from: 16, to: 30, color: getColor("green", 700) },
{ from: 31, to: 100, color: getColor("green", 800) },
{ from: 0, to: 0, color: getColor('green', 400) },
{ from: 1, to: 5, color: getColor('green', 200) },
{ from: 6, to: 15, color: getColor('green', 500) },
{ from: 16, to: 30, color: getColor('green', 700) },
{ from: 31, to: 100, color: getColor('green', 800) },
],
},
},

View File

@@ -807,6 +807,7 @@ export const decodeEntities = (encodedString) => {
}
export const getColor = (color, shade) => {
let theme = localStorage.getItem('theme') == "light" ? "lightMode" : "darkMode"
let theme =
localStorage.getItem('theme') == 'light' ? 'lightMode' : 'darkMode'
return colorsJSON[theme][color][shade]
}
}

View File

@@ -65,6 +65,6 @@ export default defineConfig({
'highlight.js',
'plyr',
],
exclude: ['frappe-ui']
exclude: ['frappe-ui'],
},
})