fix: restore previous theme colors - fixed #1559

This commit is contained in:
Liyas Thomas
2021-03-22 16:36:57 +00:00
committed by GitHub
parent 352f3af737
commit b4ac527638
4 changed files with 46 additions and 3 deletions

View File

@@ -116,7 +116,7 @@
---
- Choose theme: System, Light, Dark (default) and Black
- Choose accent color: Blue, Green (default), Teal, Purple, Orange, Pink, Red, and Yellow
- Choose accent color: Blue, Green (default), Teal, Indigo, Purple, Orange, Pink, Red, and Yellow
- Toggle auto-scroll to response
<p>

View File

@@ -83,6 +83,11 @@
--ac-color: theme("colors.green.400");
}
@mixin tealTheme {
// Acent color
--ac-color: theme("colors.teal.400");
}
@mixin indigoTheme {
// Acent color
--ac-color: theme("colors.indigo.400");
@@ -93,6 +98,11 @@
--ac-color: theme("colors.purple.400");
}
@mixin orangeTheme {
// Acent color
--ac-color: theme("colors.orange.400");
}
@mixin pinkTheme {
// Acent color
--ac-color: theme("colors.pink.400");
@@ -132,12 +142,18 @@
:root[data-accent="green"] {
@include greenTheme;
}
:root[data-accent="teal"] {
@include tealTheme;
}
:root[data-accent="indigo"] {
@include indigoTheme;
}
:root[data-accent="purple"] {
@include purpleTheme;
}
:root[data-accent="orange"] {
@include orangeTheme;
}
:root[data-accent="pink"] {
@include pinkTheme;
}

View File

@@ -2,9 +2,15 @@
<div class="flex flex-col">
<label>{{ $t("color") }}: {{ active.charAt(0).toUpperCase() + active.slice(1) }}</label>
<div>
<!-- text-blue-400 -->
<!-- text-green-400 -->
<!-- text-teal-400 -->
<!-- text-indigo-400 -->
<!-- text-purple-400 -->
<!-- text-orange-400 -->
<!-- text-pink-400 -->
<!-- text-red-400 -->
<!-- text-yellow-400 -->
<span
v-for="(color, index) of accentColors"
:key="`color-${index}`"
@@ -24,7 +30,17 @@ export default {
data() {
return {
active: localStorage.getItem("THEME_COLOR") || "green",
accentColors: ["blue", "green", "indigo", "purple", "red", "pink", "yellow"],
accentColors: [
"blue",
"green",
"teal",
"indigo",
"purple",
"orange",
"pink",
"red",
"yellow",
],
}
},
methods: {

View File

@@ -4,7 +4,9 @@
** Docs: https://tailwindcss.com/docs/configuration
** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js
*/
module.exports = {
import colors from "tailwindcss/colors"
export default {
dark: "class",
corePlugins: {
float: false,
@@ -28,6 +30,15 @@ module.exports = {
acColor: "var(--ac-color)",
actColor: "var(--act-color)",
ttColor: "var(--tt-color)",
blue: colors.blue,
green: colors.green,
teal: colors.teal,
indigo: colors.indigo,
purple: colors.purple,
orange: colors.orange,
pink: colors.pink,
red: colors.red,
yellow: colors.yellow,
},
},
fontFamily: {