I am trying to modify the tailwind.config.js
file to create some custom classes. For example, I would like to create a color palette - and do so by referencing other colors in the theme.
To do so, I have made the following changes to the tailwind.config.js
file:
module.exports = {
theme: {
extend: {
colors: {
primary: (theme) => theme("colors.blue.500"),
},
}
...
This, however, does not work. I don't get any errors - but I also do not get any custom classes either (even though, according to the docs, this should work).
On the other hand, this does work:
module.exports = {
theme: {
extend: {
colors: {
primary: "#abcdef",
},
}
...
This will create classes such as bg-primary
.
Any idea how I can create custom classes by referncing other values in the theme?
Thanks.