2022-01-03 02:40:54 +00:00
|
|
|
const plugin = require("tailwindcss/plugin");
|
2022-06-10 23:19:19 +00:00
|
|
|
const { breaks, colors, fonts, fontFamilies } = require("./design.config.js");
|
2022-02-22 02:55:38 +00:00
|
|
|
|
2022-07-03 12:34:00 +00:00
|
|
|
const rgb = (color) => [color.r, color.g, color.b].join(" ");
|
2022-02-24 01:06:25 +00:00
|
|
|
|
2022-06-10 20:50:51 +00:00
|
|
|
/** @type {import('tailwindcss').Config} */
|
2022-01-01 19:04:48 +00:00
|
|
|
module.exports = {
|
2022-02-22 02:55:38 +00:00
|
|
|
darkMode: "class",
|
2022-01-01 19:04:48 +00:00
|
|
|
content: ["./src/**/*.{tsx,ts}"],
|
|
|
|
theme: {
|
|
|
|
colors: {
|
2022-06-10 20:50:51 +00:00
|
|
|
highlight: "rgb(var(--theme-color-highlight) / <alpha-value>)",
|
|
|
|
light: "rgb(var(--theme-color-light) / <alpha-value>)",
|
|
|
|
mid: "rgb(var(--theme-color-mid) / <alpha-value>)",
|
|
|
|
dark: "rgb(var(--theme-color-dark) / <alpha-value>)",
|
|
|
|
shade: "rgb(var(--theme-color-shade) / <alpha-value>)",
|
|
|
|
black: "rgb(var(--theme-color-black) / <alpha-value>)",
|
2022-01-01 19:04:48 +00:00
|
|
|
},
|
2022-01-29 09:43:51 +00:00
|
|
|
fontFamily: {
|
2022-06-10 23:19:19 +00:00
|
|
|
body: "var(--theme-font-body)",
|
|
|
|
headers: "var(--theme-font-headers)",
|
2022-06-12 11:54:17 +00:00
|
|
|
mono: "var(--theme-font-mono)",
|
2022-06-10 23:19:19 +00:00
|
|
|
...fonts,
|
2022-01-29 09:43:51 +00:00
|
|
|
},
|
2022-02-15 14:50:51 +00:00
|
|
|
screens: {
|
2022-06-10 23:19:19 +00:00
|
|
|
desktop: breaks.desktop,
|
|
|
|
mobile: breaks.mobile,
|
|
|
|
thin: breaks.thin,
|
2022-06-10 20:50:51 +00:00
|
|
|
hoverable: { raw: "(hover: hover)" },
|
2022-06-10 23:19:19 +00:00
|
|
|
notHoverable: { raw: "(hover: none)" },
|
2022-02-17 01:49:32 +00:00
|
|
|
},
|
2022-02-18 18:29:25 +00:00
|
|
|
extend: {
|
|
|
|
boxShadow: {
|
|
|
|
"inner-sm": "inset 0 1px 4px -2px",
|
|
|
|
},
|
|
|
|
},
|
2022-01-01 19:04:48 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
2022-07-03 12:34:00 +00:00
|
|
|
plugin(({ addUtilities }) => {
|
2022-02-24 01:06:25 +00:00
|
|
|
addUtilities({
|
|
|
|
".set-theme-light": {
|
2022-06-10 23:19:19 +00:00
|
|
|
"--theme-color-highlight": rgb(colors.light.hightlight),
|
|
|
|
"--theme-color-light": rgb(colors.light.light),
|
|
|
|
"--theme-color-mid": rgb(colors.light.mid),
|
|
|
|
"--theme-color-dark": rgb(colors.light.dark),
|
|
|
|
"--theme-color-shade": rgb(colors.light.shade),
|
|
|
|
"--theme-color-black": rgb(colors.light.black),
|
2022-02-24 01:06:25 +00:00
|
|
|
"--theme-texture-dots": `url("/paper-dots.webp")`,
|
|
|
|
"--theme-texture-dots-blend": `multiply`,
|
|
|
|
},
|
|
|
|
".set-theme-dark": {
|
2022-06-10 23:19:19 +00:00
|
|
|
"--theme-color-highlight": rgb(colors.dark.highlight),
|
|
|
|
"--theme-color-light": rgb(colors.dark.light),
|
|
|
|
"--theme-color-mid": rgb(colors.dark.mid),
|
|
|
|
"--theme-color-dark": rgb(colors.dark.dark),
|
|
|
|
"--theme-color-shade": rgb(colors.dark.shade),
|
|
|
|
"--theme-color-black": rgb(colors.dark.black),
|
2022-02-24 01:06:25 +00:00
|
|
|
"--theme-texture-dots": `url("/paper-dots-dark.webp")`,
|
|
|
|
"--theme-texture-dots-blend": `overlay`,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
2022-07-03 12:34:00 +00:00
|
|
|
plugin(({ addUtilities }) => {
|
2022-03-06 15:50:17 +00:00
|
|
|
addUtilities({
|
|
|
|
".set-theme-font-standard": {
|
2022-06-10 23:19:19 +00:00
|
|
|
"--theme-font-body": fontFamilies.standard.body,
|
|
|
|
"--theme-font-headers": fontFamilies.standard.headers,
|
2022-06-12 11:54:17 +00:00
|
|
|
"--theme-font-mono": fontFamilies.standard.mono,
|
2022-03-06 15:50:17 +00:00
|
|
|
},
|
|
|
|
".set-theme-font-dyslexic": {
|
2022-06-10 23:19:19 +00:00
|
|
|
"--theme-font-body": fontFamilies.dyslexic.body,
|
|
|
|
"--theme-font-headers": fontFamilies.dyslexic.headers,
|
2022-06-12 11:54:17 +00:00
|
|
|
"--theme-font-mono": fontFamilies.dyslexic.mono,
|
2022-03-06 15:50:17 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
2022-07-03 12:34:00 +00:00
|
|
|
plugin(({ addVariant, e }) => {
|
2022-01-03 02:40:54 +00:00
|
|
|
addVariant("webkit-scrollbar", ({ modifySelectors, separator }) => {
|
2022-01-02 15:14:39 +00:00
|
|
|
modifySelectors(({ className }) => {
|
2022-01-03 02:40:54 +00:00
|
|
|
return `.${e(
|
|
|
|
`webkit-scrollbar${separator}${className}`
|
|
|
|
)}::-webkit-scrollbar`;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
2022-02-09 00:43:42 +00:00
|
|
|
// Colored Dropshadow
|
2022-07-03 12:34:00 +00:00
|
|
|
plugin(({ addUtilities }) => {
|
2022-02-09 00:43:42 +00:00
|
|
|
addUtilities({
|
2022-02-22 02:55:38 +00:00
|
|
|
".drop-shadow-shade-md": {
|
2022-06-10 20:50:51 +00:00
|
|
|
filter: `
|
|
|
|
drop-shadow(0 4px 3px rgb(var(--theme-color-shade) / 0.15))
|
|
|
|
drop-shadow(0 2px 2px rgb(var(--theme-color-shade) / 0.2))`,
|
2022-02-22 02:55:38 +00:00
|
|
|
},
|
|
|
|
".drop-shadow-shade-lg": {
|
2022-06-10 20:50:51 +00:00
|
|
|
filter: `
|
|
|
|
drop-shadow(0 10px 8px rgb(var(--theme-color-shade) / 0.2))
|
|
|
|
drop-shadow(0 4px 3px rgb(var(--theme-color-shade) / 0.4))`,
|
2022-02-09 00:43:42 +00:00
|
|
|
},
|
2022-02-22 02:55:38 +00:00
|
|
|
".drop-shadow-shade-xl": {
|
2022-06-10 20:50:51 +00:00
|
|
|
filter: `
|
|
|
|
drop-shadow(0 20px 13px rgb(var(--theme-color-shade) / 0.25))
|
|
|
|
drop-shadow(0 8px 5px rgb(var(--theme-color-shade) / 0.7))`,
|
2022-02-09 00:43:42 +00:00
|
|
|
},
|
2022-02-22 02:55:38 +00:00
|
|
|
".drop-shadow-shade-2xl": {
|
2022-06-10 20:50:51 +00:00
|
|
|
filter: `drop-shadow(0 25px 25px rgb(var(--theme-color-shade) / 0.8))`,
|
2022-02-09 00:43:42 +00:00
|
|
|
},
|
2022-02-19 01:14:16 +00:00
|
|
|
|
2022-02-22 02:55:38 +00:00
|
|
|
".drop-shadow-black-md": {
|
2022-06-10 20:50:51 +00:00
|
|
|
filter: `
|
|
|
|
drop-shadow(0 4px 3px rgb(var(--theme-color-black) / 0.15))
|
|
|
|
drop-shadow(0 2px 2px rgb(var(--theme-color-black) / 0.2))`,
|
2022-02-22 02:55:38 +00:00
|
|
|
},
|
2022-02-18 18:29:25 +00:00
|
|
|
".drop-shadow-black-lg": {
|
2022-06-10 20:50:51 +00:00
|
|
|
filter: `
|
|
|
|
drop-shadow(0 10px 8px rgb(var(--theme-color-black) / 0.2))
|
|
|
|
drop-shadow(0 4px 3px rgb(var(--theme-color-black) / 0.4))`,
|
2022-02-18 18:29:25 +00:00
|
|
|
},
|
|
|
|
".drop-shadow-black-xl": {
|
2022-06-10 20:50:51 +00:00
|
|
|
filter: `
|
|
|
|
drop-shadow(0 20px 13px rgb(var(--theme-color-black) / 0.25))
|
|
|
|
drop-shadow(0 8px 5px rgb(var(--theme-color-black) / 0.7))`,
|
2022-02-18 18:29:25 +00:00
|
|
|
},
|
|
|
|
".drop-shadow-black-2xl": {
|
2022-06-10 20:50:51 +00:00
|
|
|
filter: `drop-shadow(0 25px 25px rgb(var(--theme-color-black) / 0.8))`,
|
2022-02-18 18:29:25 +00:00
|
|
|
},
|
2022-02-09 00:43:42 +00:00
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
2022-07-03 12:34:00 +00:00
|
|
|
plugin(({ addUtilities }) => {
|
2022-01-27 02:16:32 +00:00
|
|
|
addUtilities({
|
2022-02-22 02:55:38 +00:00
|
|
|
".linearbg-obi": {
|
2022-06-10 20:50:51 +00:00
|
|
|
background: `linear-gradient(
|
|
|
|
to right,
|
|
|
|
rgb(var(--theme-color-mid)),
|
|
|
|
rgb(var(--theme-color-light)) 3%,
|
|
|
|
rgb(var(--theme-color-light)) 97%,
|
|
|
|
rgb(var(--theme-color-mid))
|
|
|
|
)`,
|
2022-02-22 02:55:38 +00:00
|
|
|
},
|
2022-01-27 02:16:32 +00:00
|
|
|
});
|
|
|
|
}),
|
2022-05-13 19:06:46 +00:00
|
|
|
|
2022-07-03 12:34:00 +00:00
|
|
|
plugin(({ addUtilities }) => {
|
2022-05-13 19:06:46 +00:00
|
|
|
addUtilities({
|
|
|
|
".break-words": {
|
|
|
|
"word-break": "break-word",
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}),
|
2022-01-01 19:04:48 +00:00
|
|
|
],
|
|
|
|
};
|