parseColor(value).color.join(" ");
+const toRGB = (value: string) =>
+ "rgb(" + parseColor(value).color.join(" ") + ")";
export default plugin.withOptions(
(_options = {}) =>
- () => {
+ ({ addUtilities, theme }) => {
+ addUtilities({
+ // Background colors
+ ".bg-def-1": {
+ backgroundColor: theme("colors.white"),
+ },
+ ".bg-def-2": {
+ backgroundColor: theme("colors.secondary.50"),
+ },
+ ".bg-def-3": {
+ backgroundColor: theme("colors.secondary.100"),
+ },
+ ".bg-def-4": {
+ backgroundColor: theme("colors.secondary.200"),
+ },
+ ".bg-def-5": {
+ backgroundColor: theme("colors.secondary.300"),
+ },
+ // bg inverse
+ ".bg-inv-1": {
+ backgroundColor: theme("colors.primary.600"),
+ },
+ ".bg-inv-2": {
+ backgroundColor: theme("colors.primary.700"),
+ },
+ ".bg-inv-3": {
+ backgroundColor: theme("colors.primary.800"),
+ },
+ ".bg-inv-4": {
+ backgroundColor: theme("colors.primary.900"),
+ },
+ ".bg-inv-5": {
+ backgroundColor: theme("colors.primary.950"),
+ },
+ // bg inverse accent
+ ".bg-inv-acc-1": {
+ backgroundColor: theme("colors.secondary.500"),
+ },
+ ".bg-inv-acc-2": {
+ backgroundColor: theme("colors.secondary.600"),
+ },
+ ".bg-inv-acc-3": {
+ backgroundColor: theme("colors.secondary.700"),
+ },
+
+ // Text colors
+ ".fg-def-1": {
+ color: theme("colors.secondary.950"),
+ },
+ ".fg-def-2": {
+ color: theme("colors.secondary.900"),
+ },
+ ".fg-def-3": {
+ color: theme("colors.secondary.700"),
+ },
+ ".fg-def-4": {
+ color: theme("colors.secondary.500"),
+ },
+ // fg inverse
+ ".fg-inv-1": {
+ color: theme("colors.white"),
+ },
+ ".fg-inv-2": {
+ color: theme("colors.secondary.100"),
+ },
+ ".fg-inv-3": {
+ color: theme("colors.secondary.300"),
+ },
+ ".fg-inv-4": {
+ color: theme("colors.secondary.400"),
+ },
+
+ // Border colors
+ ".border-def-1": {
+ borderColor: theme("colors.secondary.50"),
+ },
+ ".border-def-2": {
+ borderColor: theme("colors.secondary.100"),
+ },
+ ".border-def-3": {
+ borderColor: theme("colors.secondary.200"),
+ },
+ ".border-def-4": {
+ borderColor: theme("colors.secondary.300"),
+ },
+ ".border-def-5": {
+ borderColor: theme("colors.secondary.400"),
+ },
+ // border inverse
+ ".border-inv-1": {
+ borderColor: theme("colors.secondary.800"),
+ },
+ ".border-inv-2": {
+ borderColor: theme("colors.secondary.900"),
+ },
+ ".border-inv-3": {
+ borderColor: theme("colors.secondary.900"),
+ },
+ ".border-inv-4": {
+ borderColor: theme("colors.secondary.950"),
+ },
+ ".border-inv-5": {
+ borderColor: theme("colors.black"),
+ },
+
+ // Example: dark mode utilities (all elements within )
+ // ".dark .bg-def-1": {
+ // backgroundColor: theme("colors.black"),
+ // },
+ // ".dark .bg-def-2": {
+ // backgroundColor: theme("colors.primary.900"),
+ // },
+ // ".dark .bg-def-3": {
+ // backgroundColor: theme("colors.primary.800"),
+ // },
+ // ".dark .bg-def-4": {
+ // backgroundColor: theme("colors.primary.700"),
+ // },
+ // ".dark .bg-def-5": {
+ // backgroundColor: theme("colors.primary.600"),
+ // },
+ });
// add more base styles
},
// add configuration which is merged with the final config
@@ -71,6 +193,16 @@ export default plugin.withOptions(
950: toRGB("#461129"),
},
},
+ boxShadow: {
+ "inner-primary":
+ "2px 2px 0px 0px var(--clr-bg-inv-acc-3, #415E63) inset",
+ "inner-primary-active":
+ "0px 0px 0px 1px #FFF, 0px 0px 0px 2px var(--clr-bg-inv-acc-4, #203637), -2px -2px 0px 0px var(--clr-bg-inv-acc-1, #7B9B9F) inset",
+ "inner-secondary":
+ "-2px -2px 0px 0px #CEDFE2 inset, 2px 2px 0px 0px white inset",
+ "inner-secondary-active":
+ "0px 0px 0px 1px white, 0px 0px 0px 2px var(--clr-bg-inv-acc-4, #203637), 2px 2px 0px 0px var(--clr-bg-inv-acc-2, #4F747A) inset",
+ },
},
...typography,
},